Hi, I''m trying to find out if the following is possible. I have a rhtml template stored in the database as a string. I need to process the template (as a string), similar to using ActionView''s <%render_template("rhtml", @template_string) %>, but I need to do this in the ActionController and capture the result as a string. There is a method "render_to_string" in ActionController, however I don''t see that there is a way to pass it the template as a string. Basically I''m trying to process a template and store the result as plain html for use in another application. Any ideas.? Thanks, Joe _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi, I''m trying to find out if the following is possible. I have a rhtml template stored in the database as a string. I need to process the template (as a string), similar to using ActionView''s <%render_template("rhtml", @template_string) %>, but I need to do this in the ActionController and capture the result as a string. There is a method "render_to_string" in ActionController, however I don''t see that there is a way to pass it the template as a string. Basically I''m trying to process a template and store the result as plain html for use in another application. Any ideas.? Thanks, Joe _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Just found the answer. Thanks to RobbyOnRails for this one - found it on one of his posts. You can do: parsed_template = render(:inline => @template_text) Cheers Robby. _____ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Joe Goldwasser Sent: Friday, October 14, 2005 6:55 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] Capture template output as plain html? Hi, I''m trying to find out if the following is possible. I have a rhtml template stored in the database as a string. I need to process the template (as a string), similar to using ActionView''s <%render_template("rhtml", @template_string) %>, but I need to do this in the ActionController and capture the result as a string. There is a method "render_to_string" in ActionController, however I don''t see that there is a way to pass it the template as a string. Basically I''m trying to process a template and store the result as plain html for use in another application. Any ideas.? Thanks, Joe _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails