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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -