In a *.erb file I have a Form with controller action
In that I have 3 textbox and a submit button
while clicking submit button I want to get the value of all 3 textbox
in controller
I mean In java we ll get the value like
request.getparameter(“ID”);
Likewise how to use the request operation in Ruby controller
Kindly help me I am new to ruby on rails.
sorry for bad English
Thanks in Advance
— Antony
Antony N. wrote:
In a *.erb file I have a Form with controller action
In that I have 3 textbox and a submit button
while clicking submit button I want to get the value of all 3 textbox
in controller
I mean In java we ll get the value like
request.getparameter(“ID”);
It is params[:id] …
If you are new in ruby then I recommended that first you have to learn
basics from the tutorials…
Hi Antony,
For Example:
erb.file.U have 3 three fields.
username,useremail then useraddress in the user tables.
Table Name:users
In controller
def create
@user =User.new(params[:user])
@user.save
redirect_to :action =>‘list’
end
Otherwise u can try this one:
def create
@user =User.new()
@user.name = params[:user][:username]
@user.save
redirect_to :action =>‘list’
end
Thanks
seenu
On Mon, Oct 26, 2009 at 12:34 PM, Antony N. <
Thank you Sakthivel I Will try this
Thank you Brijesh S.
I know the basics of ruby on rails. I studied from those links only.
Can you send me any articles of using Params effectively…
Thanks In Advance,
Antony