Besides, of course, using different controller names
;). The first URL is publicly accessible, while the
second contains admin functions. Also, with the
second, subclassing the Category controller from the
Admin controller makes it inherit its class functions
(like before_filters, layout, etc.), simplifying
itself and the other children admin controllers quite
a bit.
Right now, I have a Category controller with many
before_filter only/except clauses, and render
:layout=>‘public’|‘admin’ in many functions. And I
have several other contollers - yuck. I thought about
putting everything in one big monolithic admin
controller (list_categories, edit_category,
destroy_category, list_members, list_links, etc.).
Thanks for any thoughts!
csn
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
:controller=>‘admin’, :action=>‘list’ # or
‘admin/:view/list’
admin controller:
def list
case params[:view]
when ‘categories’
render :template=>‘admin/list_categories’
when ‘items’
…
when ‘links’
when ‘members’
when ‘pages’
end
end