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 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 On Tue, Aug 23, 2011 at 4:38 PM, ramya <ramya.meena.devi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 August 2011 12:08, ramya <ramya.meena.devi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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.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 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.