How do I create custom routes in Ruby on Rails - 4.2 -


right have route below;

resources :invoices   collection     match 'search' => 'invoices#search', via: [:get, :post], as: :search   end end 

but 'deliveries#search' instead of 'invoices#search'.

i customized below routes;

get 'deliveries', to: 'invoices#index', as: :deliveries  'deliveries/new', to: 'invoices#new', as: :delivery  'deliveries/:id/edit', to: 'invoices#edit', :as => :del 

i have tried unable customized 'deliveries#search'.

any suggestions welcome.

thank in advance.

resources :invoices, path: 'deliveries'  collection   match 'search' => 'invoices#search', via: [:get, :post], as: :search  end end 

it generate route prefix deliveries /deliveries/your_action


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -