Hi, 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. TIA, Dean -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On 26 July 2012 14:45, Dean Chester <dean.g.chester-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > 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. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Hi, You need to change several things here. For example you need to move user to admin 1. in routes.rb, add this *namespace :admin do* * resources :users* *end* routes to this user resource will be prefixed by ''/admin'' like ''/admin/users/index'' 2. 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* 3. create an admin folder under views, and put all your users'' view here. done! Note you do not need to change anything to model. You can refer namespace route doc here<http://guides.rubyonrails.org/routing.html#controller-namespaces-and-routing> zvaya On Thursday, July 26, 2012 9:45:15 PM UTC+8, Dean Chester wrote:> > Hi, > > 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. > > TIA, > > Dean-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ez5U-UQZxaoJ. For more options, visit https://groups.google.com/groups/opt_out.