LoginSignup
9
7

More than 5 years have passed since last update.

requestのパラメータを取得

Last updated at Posted at 2013-10-30

URLのgetパラメーターを引き継いでgetで飛ばしたかったので調べたらこんなのがありました。

request.query_parameters

何をするかと言うと
ttp://hoge.com/fuge?hoji=123
の「hoji=123」をハッシュで取ってきてくれます。
&で繋がっていてももちろんそのまま取ってきてくれますので、

link_to "次のページへ", next_path(request.query_parameters)

なんて事もできちゃいます。

9
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
7