LoginSignup
1
3

More than 5 years have passed since last update.

railsにおいてのparamsとは

Last updated at Posted at 2017-07-25

paramsとは

railsでURLやリクエスト情報を受取るメソッド。params[パラメータ名:]で受け取れる。例えばURLのidを下記で受け取れる。

test
get "post/:id" => "post#show"
def show
  @id = params[:id]
end
1
3
2

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
1
3