save query string parameter value to database

hi,

I search google for this question but i did not find any solution for that.

I want to save parameter value to database. this parameter send by url.

for example: http://simple-beach-416.heroku.com/code/restserver?fname=cv

I want to save fname value(here "cv") to database. how can i do that?

params[:fname] will have the value "cv" in the controller action.

Colin

I generate a controller and call create model method with parameter:

  def add_item     Pers1.create(:fname => params[:fn], :lname => params[:ln])     render :text => "Success!"   end

Sorry, is there a question there?

Colin

Your code example shows

params[:fn]

Your example URL has

fname=cv

this is correct: http://simple-beach-416.heroku.com/code/restserver?fn=p1&ln=p2

Again, you must ask a question if you want help. All I see is the 'something went wrong' message at that url. This comes from your file public/500.html in your application. If you are asking why a 500 error is occurring then the first question is whether it works ok on your development pc before you push it to heroku. If it does work ok there then look at the logs on heroku for more information.

Colin