Oh noes. Trapped by the Ruby local variable ambiguity. You'll need self.layout=, as layout = defines a local in the proc's scope.
Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 On Wed, Dec 16, 2009 at 12:08 PM, George Adamson < [email protected]> wrote: > I'm trying the following but it does not seem to have any effect: > > class Notes < Application > before Proc.new { layout = false if request.ajax? } > ... > > I must be missing something?! > Cheers, > George > > > On Dec 15, 1:43 am, 刘松 <[email protected]> wrote: > > It need change "how to find the default layout if not specified by render > > method" in merb. > > By now, it only search layout by inheritance order? > > > > Use a before filter will work, but not as good. > > > > I have no more suggestion because I know less about merb's code. > > > > On Tue, Dec 15, 2009 at 6:14 AM, Nicholas Orr <[email protected] > >wrote: > > > > > use a before filter? > > > > > 2009/12/15 George Adamson <[email protected]> > > > > > Instead of checking request.ajax (or request.xhr) before deciding > > >> whether to set layout=false, is it possible to have this happen > > >> automatically? Is there somewhere I can set this more generically to > > >> apply to all actions? > > > > >> I only ask because it seems like a lot of repeated code to be testing > > >> in every controller action? > > > > >> Cheers, > > > > >> George > > > > >> -- > > > > >> You received this message because you are subscribed to the Google > Groups > > >> "merb" group. > > >> To post to this group, send email to [email protected]. > > >> To unsubscribe from this group, send email to > > >> [email protected]<merb%[email protected]>< > merb%[email protected]<merb%[email protected]> > >. > > >> For more options, visit this group at > > >>http://groups.google.com/group/merb?hl=en. > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "merb" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<merb%[email protected]>< > merb%[email protected]<merb%[email protected]> > >. > > > For more options, visit this group at > > >http://groups.google.com/group/merb?hl=en. > > > > > > -- > > You received this message because you are subscribed to the Google Groups > "merb" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected] <merb%[email protected]>. > For more options, visit this group at > http://groups.google.com/group/merb?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "merb" 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/merb?hl=en.
