Rails routing: resources with only custom actions -


i have notificationscontroller, in have action clear.

i'd access action doing post /notifications/clear

so wrote in router:

  resources :notifications, :only => []     collection       post :clear     end   end 

is there cleaner way achieve this? thought

  scope :notifications     post :clear   end 

would it, have missing controller error, because - think - looks clear controller.

thanks

if using scope, should add controller looks like

scope :notifications, :controller => 'notifications'   post 'clear' end 

or use namespace

namespace :notifications   post 'clear' end 

Comments