Hi everyone, This should be pretty simple... If you have an instance variable in a controller passed to its view, and you have <% form_remote_tag :url => { :action => ''other_action'' } do -%> etc <% end %>, can you access the instance variable in the action other_action? You''re not really changing the view... The idea is that I really need to store a variable and have it go from first action -> view -> second action -> manipulated -> passed back to the view in render :update. If the above is not possible, what is the best way to do this? Sessions? Thanks. - Shannon -- 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-/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 -~----------~----~----~----~------~----~------~--~---
i am new to ruby but i believe you can do it with the local option on partial. On Apr 15, 9:46 pm, Shannon Clipt <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi everyone, > > This should be pretty simple... > If you have an instance variable in a controller passed to its view, and > you have <% form_remote_tag :url => { :action => ''other_action'' } do -%> > etc <% end %>, can you access the instance variable in the action > other_action? > > You''re not really changing the view... > > The idea is that I really need to store a variable and have it go from > first action -> view -> second action -> manipulated -> passed back to > the view in render :update. If the above is not possible, what is the > best way to do this? Sessions? > > Thanks. > - Shannon > -- > Posted viahttp://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-/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 -~----------~----~----~----~------~----~------~--~---
Julian Leviston
2008-Apr-16 05:30 UTC
Re: instance variable in controller -> views with RJS?
pass it in on the form <% form_remote_tag :url => {:action => ''other_action'', :the_var => @the_var } do -%> then in the destination action, set @the_var = params[:the_var] Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #4 coming soon! http://sensei.zenunit.com/ On 16/04/2008, at 2:46 PM, Shannon Clipt wrote:> > Hi everyone, > > This should be pretty simple... > If you have an instance variable in a controller passed to its view, > and > you have <% form_remote_tag :url => { :action => ''other_action'' } do > -%> > etc <% end %>, can you access the instance variable in the action > other_action? > > You''re not really changing the view... > > The idea is that I really need to store a variable and have it go from > first action -> view -> second action -> manipulated -> passed back to > the view in render :update. If the above is not possible, what is the > best way to do this? Sessions? > > Thanks. > - Shannon > -- > 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-/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 -~----------~----~----~----~------~----~------~--~---
Julian Leviston
2008-Apr-16 05:31 UTC
Re: instance variable in controller -> views with RJS?
No, that''s not what he meant. Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #4 coming soon! http://sensei.zenunit.com/ On 16/04/2008, at 3:25 PM, rushnosh wrote:> > i am new to ruby but i believe you can do it with the local option on > partial. > > On Apr 15, 9:46 pm, Shannon Clipt <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> Hi everyone, >> >> This should be pretty simple... >> If you have an instance variable in a controller passed to its >> view, and >> you have <% form_remote_tag :url => { :action => ''other_action'' } >> do -%> >> etc <% end %>, can you access the instance variable in the action >> other_action? >> >> You''re not really changing the view... >> >> The idea is that I really need to store a variable and have it go >> from >> first action -> view -> second action -> manipulated -> passed back >> to >> the view in render :update. If the above is not possible, what is the >> best way to do this? Sessions? >> >> Thanks. >> - Shannon >> -- >> Posted viahttp://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-/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 -~----------~----~----~----~------~----~------~--~---
Shannon Clipt
2008-Apr-16 06:05 UTC
Re: instance variable in controller -> views with RJS?
Alright. But you can''t access it directly from the second action right? The variable I want to pass is a very long array of objects, and I was afraid it wasn''t going to be efficient if I passed it through a form (or a session). Julian Leviston wrote:> pass it in on the form > > <% form_remote_tag :url => {:action => ''other_action'', :the_var => > @the_var } do -%> > then in the destination action, set > > @the_var = params[:the_var] > > Julian. > > Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) > VIDEO #4 coming soon! > http://sensei.zenunit.com/-- 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-/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 -~----------~----~----~----~------~----~------~--~---
Shannon Clipt wrote:> > Alright. But you can''t access it directly from the second action right? > The variable I want to pass is a very long array of objects, and I was > afraid it wasn''t going to be efficient if I passed it through a form (or > a session). > > Julian Leviston wrote: >> pass it in on the form >> >> <% form_remote_tag :url => {:action => ''other_action'', :the_var => >> @the_var } do -%> >> then in the destination action, set >> >> @the_var = params[:the_var] >> >> Julian. >> >> Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) >> VIDEO #4 coming soon! >> http://sensei.zenunit.com/When you submit that form it will make a ''new'' request back to the server. Unfortunately rails really resets ''per request'' -- except for session vars and things you pass back to it. -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Shannon Clipt
2008-Apr-16 15:43 UTC
Re: instance variable in controller -> views with RJS?
by the way, the object i''m passing has sensitive data. should i still pass it through the form? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Shannon Clipt wrote:> by the way, the object i''m passing has sensitive data. should i still > pass it through the form?only if you trust the security of your clients'' computers :) I suppose if it''s sensitive save it to your session [or to a database then reload it] -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-16 15:53 UTC
Re: instance variable in controller -> views with RJS?
On 16 Apr 2008, at 16:46, Roger Pack wrote:> > Shannon Clipt wrote: >> by the way, the object i''m passing has sensitive data. should i still >> pass it through the form? > > only if you trust the security of your clients'' computers :) > I suppose if it''s sensitive save it to your session [or to a database > then reload it]bearing in mind of course that with the default session store the session data is on the client''s computer. Fred> > -- > 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-/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 -~----------~----~----~----~------~----~------~--~---
Phillip Gawlowski
2008-Apr-16 16:05 UTC
Re: instance variable in controller -> views with RJS?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Frederick Cheung wrote: | | On 16 Apr 2008, at 16:46, Roger Pack wrote: | |> Shannon Clipt wrote: |>> by the way, the object i''m passing has sensitive data. should i still |>> pass it through the form? |> only if you trust the security of your clients'' computers :) |> I suppose if it''s sensitive save it to your session [or to a database |> then reload it] | bearing in mind of course that with the default session store the | session data is on the client''s computer. | And keeping in mind that SSL should be used to encrypt transmitting sensitive information over a hostile network like the internet. - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan At the bottom of a good deal of the bravery that appears in the world there lurks a miserable cowardice. Men will face powder and steel because they cannot face public opinion. ~ -- Edwin Hubbel Chapin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgGI+QACgkQbtAgaoJTgL8NOwCfQFBk8nz1pg/KeVqocJEBxUF4 kCQAoINlRO6R8MeX/3pwfnwjqmiuDZWH =aitx -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---