51
43

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Railsでpathを確認する

Last updated at Posted at 2013-11-21

毎回忘れるのでメモ。
erbでxxx_pathという書き方でpathを示すことが多い。
どういったpathがあるのかを確認するにはコマンドラインで以下を入力する。

$ rake routes

ダラっと一覧でルーティングの内容を確認出来る。

しかし、rake routesは表示に時間が掛かるので、
rails consoleを使ってるならrails consoleの中で以下のコマンドを実行したほうが、結果の表示スピードが断然早い。

> show-routes # rails consoleの中で

参考: http://railsdoc.com/routes#%E3%83%AB%E3%83%BC%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0%E3%81%AE%E5%86%85%E5%AE%B9%E3%82%92%E7%A2%BA%E8%AA%8D

51
43
1

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
51
43

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?