views:

26

answers:

0
+1  Q: 

Routing / in Rails

I'm writing a simple Rails app with one main controller and I want to map /(:action(:id)) to this controller (basically remove the controller prefix at the beginning), but still have the path helpers I get by using map.resources.

I tried map.root :controller => 'notes', but I get an error:

undefined method `note_path' for #<ActionView::Base:0x102038b50>

where I use the link_to_unless_current function in my view.

Edit: Here is the code in index.html.erb that gives the error.

<% for note in category.notes %>
    <h3><%= link_to_unless_current h(numbered_title note), note %></h3>
<% end %>