Surely enough, accessing http://localhost:3000/ renders the
events/index.html.erb template. However, accessing http://localhost:3000/events renders the same page/template slightly
different, as the controller logic (EventsController#index) loads some
objects that’s not available at “/”. Apparently the root route doesn’t
run the controller logic at all - it only renders the template.
Is there something wrong here, or am I the one with wrong expectations?
How can I fix it?
The root route does run the controller logic, maybe there is something
mistyped in your routes.rb file.
On Sat, Oct 18, 2008 at 7:50 PM, Christian J. [email protected] wrote:
different, as the controller logic (EventsController#index) loads some
objects that’s not available at “/”. Apparently the root route doesn’t
run the controller logic at all - it only renders the template.
Is there something wrong here, or am I the one with wrong expectations?
How can I fix it?
Yup, specifying the action as a string fixed it. Strange that the action
name as symbol mapping would find the right template, but not the right
controller action. Oh, well, guess I’m not supposed to do that anyway
what happens if u just specified the controller in the mapping (with no
action at all)… the index is the default action anyway…
try
map.root :controller => “events”
On Sun, Oct 19, 2008 at 1:14 AM, Christian J. < [email protected]> wrote:
Yup, specifying the action as a string fixed it. Strange that the action
name as symbol mapping would find the right template, but not the right
controller action. Oh, well, guess I’m not supposed to do that anyway