NOTO

Specifying strings for both :path and the route path is deprecated.

 Date:2016-09-25 22:14:09 +0900
 Categories: ETC

参考にしたサイトに書いてあった path が deprecate だった。

DEPRECATION WARNING: Specifying strings for both :path and the route path is deprecated. Change things like this:

match "username", :path => ":username"

to this:

match ":username", :as => "username", :action => "username"
(called from block in at /Users/ryo/works/ryo/pubr/config/routes.rb:10)

railsのエラー表示が丁寧だったのでそれを参考に書き換えた(as, actionの代わりに to: を使用した)

# pages
- get 'username', path: ':username', to: 'pages#index', constraints: { format: /()/ }
+ get ':username', to: 'pages#index', constraints: { format: /()/ }
Tweet