Hi. Is it possible to refer to a parameter from a page in another
controller?
Paul R. wrote in post #964999:
Hi. Is it possible to refer to a parameter from a page in another
controller?
Your question is unclear as stated. More details?
Best,
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
Sent from my iPhone
rom a page in another
controller?
means…
On Tue, Nov 30, 2010 at 9:36 AM, Marnen Laibow-Koser
[email protected]wrote:
[email protected]
To unsubscribe from this group, send email to
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
–
Thanks:
Rajeev sharma
+919013155133
Sure. I have a page in (view\controller x) with an input field.
Submitting the form displays the value of the input field on this same
page.
There is a link on this page that connects to another page in a
different view/controller (view\controller y). I want to use the param
(input field value) as a conditon in a ‘find’ in the controller y. But I
am not yielding results. It’s like the param is empty. I hope this makes
it a little clearer
basically you got two possibilities:
-
write the value into a session-variable
session[:object] = “some string or value” -
pass your value as a parameter to some action and read params in
your controller:
view:
<%= link_to “my_action” :controller => :bla, :action
=> :my_action, :object => “some string or value” %>
controller:
def my_action
puts params[:wtf]
end
On Tue, Nov 30, 2010 at 9:46 AM, Paul R. [email protected]
wrote:
–
Thanks:
Rajeev sharma
+919013155133
Thanks