开发者

Ruby on Rails: Saving query string parameter value to database

开发者 https://www.devze.com 2023-03-04 13:29 出处:网络
I search goo开发者_StackOverflow中文版gle for this question but i did not find any solution for

I search goo开发者_StackOverflow中文版gle 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?


Make a model for it? This is very vague... but define a model called Fname and give it the attribute "value"

Then...

Fname.create(:value => params[:fname])

I think this is where you're going, yeah?

0

精彩评论

暂无评论...
验证码 换一张
取 消