In one of my views I used to have the line:
<%= link_to 'Show', form %>
Which looked neat. According to 'rake routes', I should now be able to use
backend_form:
backend_form GET /backend/forms/:id
{:controller=>"backend/forms", :action=>"show"}
But that gives me:
undefined local variable or method `backend_form' for
#<ActionView::Base:0x19fae86>
So now we have this:
<%= link_to 'Show', :controller=>"backend/forms", :action=>"show" %>
Which works but is less neat.
My app/views directory looks like this:
backend
admin
elements
forms
layouts
users
My controllers are now layout-less. Should the layouts dir be one higher?
On Sat, Sep 20, 2008 at 5:13 PM, Erol Fornoles <[EMAIL PROTECTED]>wrote:
>
> On Sep 20, 9:57 pm, "Commander Johnson" <[EMAIL PROTECTED]>
> wrote:
> > I experimented with this line in routes.rb:
> > map.root :controller => :forms
> >
> > instead of
> >
> > map.root :controller => "forms"
> >
> > That caused the 500 error.
> > Now that last statement is valid, but doesn't work. How do I make the
> root
> > path '/' point to Backend::FormsController?
> >
> > When I log in as admin, I get the error:
> >
> > undefined method `form_path' for #<ActionView::Base:0x76ec1a>
> >
> > How do I make the *_path method understand what namespace we're in?
> >
> > CmdJohnson
>
> You'll need to point to the path of the controller. So for your
> Backend::FormsController, the root route should be set as:
>
> map.root :controller => "backend/forms"
>
> Since Backend::FormsController resides on backend/forms.rb
>
> Also, the path and url helpers for your namespaced controllers are now
> named backend_{controller}_path. You can confirm this - and check out
> all the other routes, as well - by running:
>
> rake routes
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---