Using Links With Angular Js And Rails

Posted by Weston Ganger

Using Angular Routing we need some configuration for links:

 

First we must turn html5mode on for angular by adding the following to your apps config:


app.config(['$locationProvider', function($locationProvider){
  $locationProvider.html5Mode(true);
});

Add the following catch all route to the end of config/routes.rb:

get "*path", to: "youController/index"

Now you can format your links just like you normally would.

Article Topic:Software Development - Rails

Date:July 31, 2014

Recommended Posts

Contact

604-309-8713
info@solidfoundationwebdev.com

Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected