I have form tag helpers such as
form_for(:session, url: sessions_path, name: "signin_form", "ng-controller":
"signinctrl") do |f| %>
Whenever I go the page however I get an error from rails saying
unexpected tASSOC
Why is Rails not accepting the ng-controller
attribute? My controller is defined in a different file and my ng-app is defined in the html tag.
The problem is here: "ng-controller": "signinctrl"
The Ruby 1.9 hash syntax only supports symbols (without colons), such as ng-controller: "signinctrl"
(which would be the same as :ng-controller => "signinctrl"
.
To fix it, you'll just have to use the 1.8-style hash syntax. You can mix and match that into the hash without changing the rest of the properties:
form_for(:session, url: sessions_path, name: "signin_form", "ng-controller" => "signinctrl") do |f| %>
Have you try with "data-ng-controller" ?