Hi all,
Relative RoR newbie here. I’ve been researching routes, but I haven’t found what I need.
I have an app which has one primary controller (store) which provides a web UI (there are several other controllers for internal ‘stuff’). What I’m trying to do is completely remove the controller name from all generated URLs.
Here’s what I currently have in the routes file:
ActionController::Routing::Routes.draw do |map|
...
map.connect '', :controller => 'store'
map.connect ':controller/:action/:id'
...
end
In my templates, the following link_to
<%= link_to "Home", :action => "index" -%>
generates the following URL:
[http://localhost:3000](http://localhost:3000)/
Any action other than ‘index’ seems to insert the controller name into the URL. For example, this link_to
<%= link_to "News", :action => "display_news" -%>
generates the following URL:
[http://localhost:3000/store/display_news](http://localhost:3000/store/display_news)
What I would like the previous link_to to generate is:
[http://localhost:3000/display_news](http://localhost:3000/display_news)
Any help is appreciated.
Carpe viam,
Mike
Michael Larocque
Chief Cook and Bottle Washer
Prolumina Communications Inc.