From: Ben Simms Date: 2008-04-05T03:17:53+09:00 Subject: New to RoR. Using text input as a parameter in query. I'm new to RoR and I am trying to figure out how to use user input from a text field as a parameter in a query. I know this is probably simple but I have been messing around with it for a while and can't figuire it out. The controller has this method: def search @events = Event.find(:all, :order => 'date DESC', :conditions => ['title=?',titleinput]) respond_to do |format| format.html format.xml { render :xml => @events } end end and the view:

Title

I know this is probably completely wrong but I couldn't figure out how to use the variable from the form in the query in the controller. Thanks for any help. Ben -- Posted via http://www.ruby-forum.com/.