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!!
on 2007-01-23 18:06
on 2007-01-24 03:42
On 1/24/07, Phlip <email@example.com> wrote: > > 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? ;-)
on 2007-01-26 16:28
Dear Phlip, I am too lazy to respond. RSL [Heh. I couldn't resist. The devil made me do it.]
on 2007-01-26 21:48
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!!