On Sep 21, 5:59 am, "Commander Johnson" <[EMAIL PROTECTED]>
wrote:
> 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?

You'll need to append _url or _path for the url helpers to work. ;)

Layouts are namespace agnostic. Specifying layout "backend" in your
Backend::ElementsController, for example, would load "app/views/
layouts/backend.erb" as that controller's layout.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to