Redirecting to a form from the controller

Hi,

I need to pass the parameters from a method in a controller to a form (i.e in views). Please let me know how to achieve this.

Thanks, Ramya.

you got to store the values in the controller def then with the id you can pass the values to view .but u can send the value with a link or with redirecting here it is def demo @all=params[:t1] redirect_to :controller=>‘here ur controller name’,:action=>‘here ur view page name’,:id=>@a

end here the name of the id is not constant u can give any name here . i hope u will get it

you got to store the values in the controller def then with the id you can pass the values to view .but u can send the value with a link or with redirecting here it is def demo @all=params[:t1] redirect_to :controller=>‘here ur controller name’,:action=>‘here ur view page name’,:id=>@a

end here the name of the id is not constant u can give any name here . i hope u will get it

It is not clear exactly what you want to do, but if you are a beginner at Rails then I suggest working through some tutorials for Rails as this will give you a better understanding of how the framework functions and will probably allow you to answer your own questions. railstutorial.org is good and is free to use online. Also have a good look at the Rails Guides. Make sure that you are using Rails 3 and that the tutorials are for that version.

Colin

ramya wrote in post #1018047:

Hi,

I need to pass the parameters from a method in a controller to a form (i.e in views). Please let me know how to achieve this.

def your_method(x, y, z)   @x, @y, @z = x, y, z end