Recognize routes in rails console Session

前端 未结 5 2084
无人共我
无人共我 2020-12-12 10:25

Say I have a router helper that I want more info on, like blogs_path, how do I find out the map statements behind that in console.

I tried generate and recognize and

5条回答
  •  Happy的楠姐
    2020-12-12 10:57

    In the console of a Rails 3.2 app:

    # include routing and URL helpers
    include ActionDispatch::Routing
    include Rails.application.routes.url_helpers
    
    # use routes normally
    users_path #=> "/users"
    

提交回复
热议问题