开发者

URL in rails 2.3.10

Hey guys! How possible can make link like this: http://localhost:3000/questiond_id=5&token=73489开发者_如何学运维3789568495 (there will be only one question (form) and token (unique) for them and that all)

? in routers.rb ? Or where?

Thank you very much!


In rails you can access like this:

 http://localhost:3000/questions/5?token=734893789568495

In routes.rb file

 resources :questions

You can restrict this by only option if you don't want other actions.

For this, you can use show action of questions controller and your path will be like this

 question_path(:id => 5, :token => '734893789568495')
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜