hyperrjas
hyperrjas

Reputation: 10744

Protect admin devise route

I have this in my routes.rb

devise_for :admins

If I put in URL http://localhost/admins/sign_in, I get the sign_in form for admin model.

I have check this for camouflage this form, to:

devise_for :admins, :path => "/d7cispx45g"

but I still can access through http://localhost/admins/sign_in.

How can I protect this form so that only I know the path to login as administrator?

Upvotes: 1

Views: 908

Answers (1)

iain
iain

Reputation: 16274

For the karma:

You can scope your devise routes with the scope option:

scope "/d7cispx45g" do
  devise_for :admins
end

Upvotes: 4

Related Questions