On Fri, Oct 22, 2010 at 10:04 AM, Leonel *.* <[email protected]> wrote:
> Ok so I read the introductory documentation for Devise. I'm going to
> create an Admin controller too.
Manage roles with a roles model not with a model for every role, it
creates a lot of problems later on.
what I can't find out though, I have
> googled it several times too, is how to apply a Layout file for a
> specific method of the same Class.
>
>
> For example, the User class: the sign up, sign in and index methods are
> supposed to have different layouts.
>
> The sign up should be a page with just a no-link logo and just the form
> so I won't distract the user from signing up.
>
> The sign in also a very basic for asking for username and password.
>
> The index is supposed to be displayed AFTER the user has logged in and
> he can be able to see a list of users.
>
> You get the idea.
>
> I had read that Rails looks for a specific class layout and if it
> doesn't find it, it goes for application.html.erb I tried adding layout
> files in the layout directory users.html.erb sessions.html.erb but it
> doesn't work. So how can I setup the different layouts?
>
> --
>
use this and set the layout based on the devise_scope (the example is based
on the controllers)
layout :layout_by_resource
def layout_by_resource
if devise_controller?
"layout_name_for_devise"
else
"application"
end
end
--
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.