Dear group,
What are the most elegant ways in Rails to pass the VARIABLE’s value:
- from action A
- to action B?
Until now, I’ve been doing this like this (but I’m sure there are other
ways):
- In action A: redirect_to :action => ‘B’, :id => VARIABLE
- In action B: variable = params[:id]
OR:
- In action A: display a form (form_for :myForm") with a hidden field +
pass the hidden field a value - In action B: value = params[:myForm][:myHiddenField]
What are the most elegant for passing values in the most direct way?
Is it possible to easily pass values that are not visible to the user?
Thanks a lot!
Tom