Rails: how do you access RESTful helpers?

后端 未结 5 571
眼角桃花
眼角桃花 2020-12-23 14:02

I\'m trying to work through this guide to Rails routing, but I got stuck in section 3.3:

Creating a RESTful route will also make available a pile of h

相关标签:
5条回答
  • 2020-12-23 14:33

    From memory, you can't call url/path helpers from the console for some reason.

    0 讨论(0)
  • 2020-12-23 14:36

    I think this may be what you are looking for ... http://topfunky.com/clients/peepcode/REST-cheatsheet.pdf

    0 讨论(0)
  • 2020-12-23 14:52

    You can access other helpers in the console by prepending "helper."; ie. helper.progress_box (assuming #progress_box exists of course)

    0 讨论(0)
  • 2020-12-23 14:56

    You have several questions in there, most of which have already been answered by people below.

    The answer to one that wasn't fully addressed however, is: yes you can use the script/console to see where your routes go. Just type in app.[route_helper] and it will respond with the path. For example app.users_path will return /users/

    So for your example type app.entries_url for the full URL - or app.entries_path for its relative path within the console.

    0 讨论(0)
  • 2020-12-23 14:59

    rake routes at the command line should get you that list.

    0 讨论(0)
提交回复
热议问题