B
B
bismoney2015-10-25 11:10:48
Ruby on Rails
bismoney, 2015-10-25 11:10:48

How to remove post/new?

Hi all.
I don’t understand much logic, I seem to read everything, but I can’t understand it.
It is not difficult for anyone to give a short answer.
When creating, for example, a scaffold Post
, such routes appear

post
post/new
post/edit 
и.т.д

I made a grouping of controllers in Admin:
In route
namespace :admin do
  resources :posts, :categories, :types
end

Accordingly received
admin/post
admin/post/new
admin/post/edit

How to remove now these paths, since they are no longer needed.
post/new
post/edit

And I still can’t understand, I have limited access to /admin in the controller
http_basic_authenticate_with name: "admin", password: "secret"

And going to site.ru/admin requires a password.
But if I go to site.ru/admin/post/new without entering a password, then I can easily create a post. (I know about devise and authorization)
How to restrict access to everything admin?
Thanks to everyone who will spare no time and take a minute.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question