Hello,
I’m still relatively new to Ruby/Rails and am in the middle of my first
deployment to production. I’ve encountered an odd difference between
development and production mode, and I’m not sure what the cause is.
My site is set up under two main controllers, “secure” and “admin”.
Each of these has several sub-controllers, for example: “admin/users”,
“admin/announcements”, etc.
On my development site, the links between these controllers all work
fine. However, when I moved to production, the links no longer work
unless I pass along an :id or other parameter through the querystring
params.
In other words, this results in a page not found error:
<%= link_to ‘Announcements’, {:controller => ‘admin/announcements’,
:action => ‘index’} %>
And this works:
<%= link_to ‘Announcements’, {:controller => ‘admin/announcements’,
:action => ‘index’, :id => ‘0’} %>
And both work in my development environment.
Without the parameters, I get the following error in my production.log
file:
Processing AdminController#announcements (for xxx at xxx) [GET]
Session ID: xxx
Parameters: {“action”=>“announcements”, “controller”=>“admin”}
ActionController::UnknownAction (No action responded to announcements):
Why is the production box looking for a method within admin whereas the
development box is correctly finding the controller? Is this a server
setting somewhere? Again, it’s the same code in both locations…