Hairi
Hairi

Reputation: 3715

Extend resource path in rails

I am new to Ruby and Rails, so question may look trivial to you.

Here is a snippet from the route file to explain what I am asking for:

namespace :admin do

  resources :database_managers
  post :admin_database_managers_path/some_extension_here, as database_managers_extended
end

since I already have this database_managers resources I want to extend it using the resources path. So when the resources path change the extended routes to be extended too.

Upvotes: 1

Views: 375

Answers (1)

Hardik Upadhyay
Hardik Upadhyay

Reputation: 2659

I think you are looking for.

namespace :admin do
  resources :database_managers do
    collection do
      post :some_extension_here
    end
  end
end

Upvotes: 1

Related Questions