Railsers: I am too lazy to write an RHTML file. I just want to write an action, and stuff a string. The string needs ActionView things inside it, like this: def lazy render :text => stylesheet_link_tag(''application'') + ... end How do I get lines like that working? -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/24/07, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Railsers: > > I am too lazy to write an RHTML file. I just want to write an action, > and stuff a string. The string needs ActionView things inside it, like > this: > > def lazy > render :text => stylesheet_link_tag(''application'') + ... > end > > How do I get lines like that working?render :text => response.template.link_to(''STFW'', ''http://google.com/'') You could also use method_missing to automatically delegate to ''response.template'': def blah render :text => link_to(''STFW'', ''http://google.com/'') end def method_missing(*args, &block) response.template.send(*args, &block) end Lazy enough for you? ;-) --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Dear Phlip, I am too lazy to respond. RSL [Heh. I couldn''t resist. The devil made me do it.] On 1/23/07, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Railsers: > > I am too lazy to write an RHTML file. I just want to write an action, > and stuff a string. The string needs ActionView things inside it, like > this: > > def lazy > render :text => stylesheet_link_tag(''application'') + ... > end > > How do I get lines like that working? > > -- > Phlip > http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Russell Norris wrote:> I am too lazy to respond.That contradicts itself; you did respond. The answers so far be... - render :inline => ''...'' - render :file => ''...'' - response.template.blah(), as George Ogata reports. -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---