LoginSignup
24
17

More than 5 years have passed since last update.

Railsのparamsからcontrollerとかpathに関係するパラメータを除きたい

Posted at

railsのparamsって{controller: "posts", action: "index"}みたいなpathに関する情報が入ってきてたまに邪魔だったりします。

POSTデータとかだけ取りたい場合には下記みたいに取得すればいいみたいですね。

request.request_parameters

URLについてくるクエリパラメータだけ取りたい場合はこう。

request.query_parameters

パスのデータだけも取れるみたいですね。

request.path_parameters
24
17
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
24
17