I was wondering if anyone more experienced could help me to find a good
pattern for two things:
How to group controllers. Example:
We have an admin panel with:
user_managment_controller.rb
priv_managment_controller.rb
widget_controller.rb
User panel with:
mystuff_controller.rb
mytags_controller.rb
profile_controller.rb
And frontend with:
widget_controller.rb
etc…
How do I group those controllers? Should I put them in subdirectories?
Does rails support this automagically?
and
I have a model/table Widget with fields a,b,c,etc.
Lets say guest can edit fields a,b
users: a,b,c,d
moderators1: a,b,c,d,e,f,g
moderators1: a,b,c,d,g,h,i
admins: a-z
How do I implement this? Can I create a model-class for each user-group?
How do I make sure that certain fields cannot be edited (for example by
Widget.update_attributes(params[:widget])?
Thanks
PS: Obviously I want to make it ADAP (as DRY as possible)
I need it to:
map.forum ‘:controller_without_module/:action/:id’,
:controller => ‘forum/:controller_without_module’,
:requirements => { :subdomain => ‘forum’ }