Hi, iam a newbie to rails , i wanna know how can i capture data entered
in a web page by a user
For example, to obtain the data entered in a text field in a JSP in
Java we write request.getParameter(“textfieldname”)
similarly for any form element, we use this method to get the entered
data in the web page
Like wise what is the code in Ruby to capture this ? and where should i
write this code ? Is it in model or in controller?
i am aware that ruby automatically maps the form element names with that
of the database columns names and save accordingly, but if i need to
display these values
before saving them in the database, how can i capture them in the
controller before the save method is called?
From the manual you need to get how to display a form in rails so that it
indeed gets mapped to the AR-Model.
Let’s say you’ve got an input form for a User. Then, if you made up the
form
according to the rails convention you are able to get a hash of the
input by
using params[:user] in the controller.
Rails is so well documented - at first you might have a look at the
videos -
that you shouldn’t have any problems, especially when you were into web
development with java.
Cheers,
Jan
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.