Hello guys i am a newbie in rails and need your guidance in the design of the app. i am working on a task of creating a store application. its a bit diiferent as people can register as customer and also as seller (like in ebay) and there is also a superadmin so the levels are 1.superadmin 2.sellers 3.customers i am using rails 2.0.2 and was looking at how to create a admin section for such app. i saw railscast no 19,20,21 by ryan bates for creating admin section he does create any admin folder and hides the links the views on the basis of if admin had logged in I also saw video by akitaonrails where he creates seperate admin folder and copies the views specifically in my case the difference in views for products for different levels wud be 1. superadmin : all products by all sellers (all actions) 2. seller : all products added by him only (all actions allowed) 3. customers :all products by all sellers (only view ) pls guide me which approch shud i use Regards Jagdish Rao -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''m very new too, but I did recently learn about using namespaces to create the admin section if you want to keep it separate. It sounds like the "REST" thing to do anyway. You might have a look at the article I looked at and see if its applicable. I''m sure others know better though. :) http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial On Apr 8, 11:34 am, Jags Rao <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello guys > > i am a newbie in rails and need your guidance in the design of the app. > > i am working on a task of creating a store application. > its a bit diiferent as people can register as customer and also as > seller (like in ebay) and there is also a superadmin > > so the levels are > 1.superadmin > 2.sellers > 3.customers > > i am using rails 2.0.2 and was looking at how to create a admin section > for such app. > > i saw railscast no 19,20,21 by ryan bates for creating admin section > he does create any admin folder and hides the links the views on the > basis of if admin had logged in > > I also saw video by akitaonrails where he creates seperate admin folder > and copies the views > > specifically in my case the difference in views for products for > different levels wud be > > 1. superadmin : all products by all sellers (all actions) > 2. seller : all products added by him only (all actions > allowed) > 3. customers :all products by all sellers (only view ) > > pls guide me which approch shud i use > > Regards > Jagdish Rao > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can also just use a before_filter like (in my app, anyone can see anything, but only certain roles can affect certain things, like Users): class UsersController < ApplicationController layout ''testbase.html.haml'' before_filter :login_required before_filter :check_administrator_role, :except => [:index, :show] blah blah blah end The various views restrict the links and buttons so people can''t see what they can''t do, but the controller enforces it as well to keep out the URL manglers. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---