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?
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).
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.
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