Well, I didn't understand your explanation much, but let me explain myself about what I meant by the line
> Requiring the same action for multiple controllers is quite uncommon, If you are trying to render the _same thing_ on two different routes, that thing isn't itself DRY. Use "redirect_to()" instead. If you want to really render the same thing on two different actions, that's what partials are for. See http://guides.rubyonrails.org/layouts_and_rendering.html#using-partialsfor more details. What I understood from your text is that "Reading" is common for both Main and Admin. If the common code is totally database specific, you should be using a class method of the model instead. And just call it in action like, say, @read_user = ModelName.custom_read(params[:something]) Hope that helps. Let me know your thoughts. 2009/7/28 djolley <[email protected]> > > 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 > > > > -- -nasa http://its.raining.in --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

