How to add additional rest routes to a nested resource in rails -


i have widget has many links. in routes file:

map.resources :widgets, :has_many => [:links] 

i want add "sort" action links. need add routes file, can write sort_widget_links_path(widget)

you can define using block:

map.resources :widgets |widget|   widget.resources :links, :member => {:sort => :get} end 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -