Greg Hauptmann
2008-Dec-05 21:13 UTC
from within a View, how can I render the text output from a separate controller action???
Hi, Question = From within a View, how can I render the text output from a separate controller action??? (call it graph/get_data) So it''s not a partial, as what I want to do is make a separate call to get the data to display. Background = I have a two step process for an ad-hoc report. The first step is to gather the options, then the second action/view is to display. The thing is in the display view the graph is actually an embedded Flash object and it gets it''s data via the URL of my graph/get_data controller/action. To pass the options from the collect to display steps I used Flash however. So the side effect is that I can''t just navigate to the graph/get_data URL and see the XML data anymore, as it relies upon the flash object being there for all the details of the graph. To aid in bug finding I''m just after a way (when I''m attempting to display the graph) to see the output from the graph/get_data controller/action, which is XML using the Rails builder views. Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Greg Hauptmann
2008-Dec-07 02:24 UTC
Re: from within a View, how can I render the text output from a separate controller action???
bump - still interested if anyone knows On 12/5/08, Greg Hauptmann <greg.hauptmann.ruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Question = From within a View, how can I render the text output from a > separate controller action??? (call it graph/get_data) > > So it''s not a partial, as what I want to do is make a separate call to > get the data to display. > > Background = I have a two step process for an ad-hoc report. The > first step is to gather the options, then the second action/view is to > display. The thing is in the display view the graph is actually an > embedded Flash object and it gets it''s data via the URL of my > graph/get_data controller/action. To pass the options from the > collect to display steps I used Flash however. So the side effect is > that I can''t just navigate to the graph/get_data URL and see the XML > data anymore, as it relies upon the flash object being there for all > the details of the graph. To aid in bug finding I''m just after a way > (when I''m attempting to display the graph) to see the output from the > graph/get_data controller/action, which is XML using the Rails builder > views. > > Thanks >-- Sent from my mobile device --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
s.ross
2008-Dec-07 03:34 UTC
Re: from within a View, how can I render the text output from a separate controller action???
I don''t know if this is what you are after, but it would make sense that you could do something like this: def action_that_renders_lots_of_stuff separate_action render :action => separate_action end def separate_action # set a bunch of instance variables end Also consider render_to_string as a way to capture the output to do with as you please later. Hope this helps. On Dec 6, 2008, at 6:24 PM, Greg Hauptmann wrote:> > bump - still interested if anyone knows > > On 12/5/08, Greg Hauptmann <greg.hauptmann.ruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hi, >> >> Question = From within a View, how can I render the text output >> from a >> separate controller action??? (call it graph/get_data) >> >> So it''s not a partial, as what I want to do is make a separate call >> to >> get the data to display. >> >> Background = I have a two step process for an ad-hoc report. The >> first step is to gather the options, then the second action/view is >> to >> display. The thing is in the display view the graph is actually an >> embedded Flash object and it gets it''s data via the URL of my >> graph/get_data controller/action. To pass the options from the >> collect to display steps I used Flash however. So the side effect is >> that I can''t just navigate to the graph/get_data URL and see the XML >> data anymore, as it relies upon the flash object being there for all >> the details of the graph. To aid in bug finding I''m just after a way >> (when I''m attempting to display the graph) to see the output from the >> graph/get_data controller/action, which is XML using the Rails >> builder >> views. >> >> Thanks--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mukund
2008-Dec-07 04:46 UTC
Re: from within a View, how can I render the text output from a separate controller action???
Once you decide on an HTML element to hold the results from the controller action, you can do simple things like a "remote_function" to update it. You can render a partial into a div as well, so don''t bother trying to generate HTML tags in your controller. On Dec 6, 2:13 am, "Greg Hauptmann" <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Question = From within a View, how can I render the text output from a > separate controller action??? (call it graph/get_data) > > So it''s not a partial, as what I want to do is make a separate call to > get the data to display. > > Background = I have a two step process for an ad-hoc report. The > first step is to gather the options, then the second action/view is to > display. The thing is in the display view the graph is actually an > embedded Flash object and it gets it''s data via the URL of my > graph/get_data controller/action. To pass the options from the > collect to display steps I used Flash however. So the side effect is > that I can''t just navigate to the graph/get_data URL and see the XML > data anymore, as it relies upon the flash object being there for all > the details of the graph. To aid in bug finding I''m just after a way > (when I''m attempting to display the graph) to see the output from the > graph/get_data controller/action, which is XML using the Rails builder > views. > > Thanks--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---