开发者

Ruby on Rails: Saving query string parameter value to database

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜