Help us understand the problem. What is going on with this article?

Railsでpathを確認する

More than 5 years have passed since last update.

毎回忘れるのでメモ。

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

nantekkotai
意識の低いフロントエンドエンジニア。主にJSを嗜みます。
http://nantekkotai.hatenablog.com/
diggle
経営管理に必要な予実分析のためのB2B-SaaS スタートアップ
https://diggle.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした