save query string parameter value to database


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

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

for example:

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.


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!"

Sorry, is there a question there?


Your code example shows


Your example URL has


this is correct:

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.