layout "reports", :except => [:statistics] layout "stat_report", :only => [:statistics] I want to specify the use of 2 different layout in my controller but the above syntax doesn''t work? How can I do this? 어떻게 하죠? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, 2009-11-23 at 18:09 -0800, eggie5 wrote:> layout "reports", :except => [:statistics] > layout "stat_report", :only => [:statistics] > > I want to specify the use of 2 different layout in my controller but > the above syntax doesn''t work? How can I do this? 어떻게 하죠?---- keep the first, ditch the second and within def stat_report ...whatever else exists goes here render :layout => ''statistics'' end Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
write something like this
layout :compute_layout
protected
def compute_layout
if action_name=="statistics"
return "stat_report"
else
return "reports"
end
On Nov 24, 7:19 am, Craig White
<craigwh...-BQ75lA0ptkhBDgjK7y7TUQ@public.gmane.org>
wrote:> On Mon, 2009-11-23 at 18:09 -0800, eggie5 wrote:
> > layout "reports", :except => [:statistics]
> > layout "stat_report", :only => [:statistics]
>
> > I want to specify the use of 2 different layout in my controller but
> > the above syntax doesn''t work? How can I do this? 어떻게 하죠?
>
> ----
> keep the first, ditch the second and within
>
> def stat_report
> ...whatever else exists goes here
> render :layout => ''statistics''
> end
>
> Craig
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.