I want to develop my resources that deal with CRUD operations on my
models in a namespace of /admin. How is the best approach to do this?
What needs to be changed in order to do this? As in my last attempt of
moving things to a namespace my software broke.
I want to develop my resources that deal with CRUD operations on my models in a
namespace of /admin. How is the best approach to do this? What needs to be changed
in order to do this? As in my last attempt of moving things to a namespace my
software broke.
First make sure you are using a source control system such as git so
that you can do the work on a branch and can easily go back if there
are problems. Secondly make sure you have complete automated test
coverage and modify the tests before modifying the code so that you be
sure it is all working correctly.
resources :users* end
routes to this user resource will be prefixed by ‘/admin’ like
‘/admin/users/index’
create users_controller.rb under admin folder in /app/controllers
in users_controller.rb, name the class using admin namespace, like class Admin::UsersController < ApplicationController end
create an admin folder under views, and put all your users’ view
here.
done!