[Ruby on Rails] How to get the current URL (including parameters)
Notes on various patterns for getting the current URL in Ruby on Rails 3.
■ When you want to use the URL with parameters as is
url_for(params)
■ When adding parameters
url_for(params.merge(foo: 'bar'))
■ When removing parameters, set them to nil
url_for(params.merge(foo: nil))
・Railsで現在のURLにパラメーターを追加/削除したURLを取得 - このブログは証明できない。
That’s all from the Gemba.