Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Using match with namespace

#5385

I have namespace "admin" and controller "Accounts" with namespace "Admin".
And Controller Accounts has method change_password.
I want have route admin/accounts/change_password.

For this I try using member

namespace :admin do

resources :accounts do
  member do
    get :change_password
  end
end

end

But my method "change_password" does not have identificator(1) (admin/accounts/1/change_password/).

What can I use for this?

Reported by Utyasheva Oksana · August 16th, 2010 @ 09:37 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Andrew White
    Andrew White
    • State changed from new to invalid
    • Importance changed from to Low

    I think you're trying to change the password of the currently logged in admin, yes? In that case use resource instead of resources:

    namespace :admin do
      resource :account do
        member do
          get :change_password
        end
      end
    end
    

    In future can you please use the general mailing list for support - this website is for reporting bugs in Rails.

    August 20th, 2010 @ 12:21 AM