[Rails] Re: Rails 3 - possible to render a view into a string (inside a model or controller)?
David Kahn wrote in post #957895:
> In Rails 2 I could do this to get the view as a string (i.e. to save it
> to a
> file):
>
> av = ActionView::Base.new(Rails::Configuration.new.view_path)
> html = av.render(
> :partial => "comparisons/display",
> :locals => { :comparison => self, :format_html => nil,
> :print_view
> => print_view, :fully_qualified_url_prefix =>
> fully_qualified_url_prefix,
> :user => user }
> )
>
> In Rails 3 it seemingly does not work anymore.
Did you perchance want render_to_string (which also exists in Rails 2)?
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
Posted via http://www.ruby-forum.com/.
--
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@googlegroups.com.
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home