On Dec 2, 8:03 pm, Kenneth McDonald
<kenneth.m.mcdon...-rphTv4pjVZMJGwgDXS7ZQA@public.gmane.org>
wrote:> I have a situation where it would be useful to generate ERB directly
> from Rails code, rather than taking it from a file. Is this possible?
> If so, how would one go about it?
>
Well there''s render :inline if you''re in a controller or you
can just
use erb directly
greeting = world
ERB.new("hello <%= greeting %>").result binding #=>
"hello world"
Fred> Thanks,
> Ken McDonald
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---