I'm trying to style a rails link using css using the following code:
<%= link_to "Learn More", :controller => "menus", :action => "index", :class => "btn btn-inverse" %>
I would expect that this would create a link that looks like this:
<a href="menus/" class="btn btn-inverse">Learn More</a>
Instead, rails is rendering this -
<a href="/menus?class=btn+btn-inverse">Learn More</a>
Has anyone else had this problem / know what I'm doing wrong? I know I can avoid this problem by manually creating the anchor tag rather than using helper, but I was wondering if there was a way to pass the css class info to the helper itself. I'm using Rails 3.2.6.
Thanks!
menus_path
as the second argument tolink_to
instead of specifying the controller and action. – James