First of all, your solution works great! Thanks.
> Requiring the same action for multiple controllers is quite uncommon,
> there may be better methods to do the same thing.
Believe me, when someone tells me something like that, I listen
because the person speaking is usually right. I really want to avoid
doing things in an unorthodox way and/or in a way that makes things
more difficult than they need to be. Perhaps the problem is that I
have too many controllers. In this case, I have a 'main' controller
for general purpose actions and an 'admin' controller for
administrative actions. Access to the admin controller is limited to
the admin user. The action in question provides a gateway to all of
the CRUD capabilities; however, I want only the administrative user to
have access to the CUD capabilities. In addition, the views are also
different because the admin view includes the CUD capabilities. Given
these circumstances, I thought it would be nice to have a copy of this
action in both the admin controller and the main controller. But, I
want to keep my code DRY. So, it seemed to me that the logical thing
to do would be to place the action in the application controller and
let it inherit down to both the main and admin controllers. It seems
to work just fine. Do you still think that I'm on the wrong track?
Thanks for the input.
... doug
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---