Hi Bob,
It depends on how you have your controllers setup - really. For
instance, I have a Universal controller template that 37 other
controllers use.
class UniversalTemplatesController < ApplicationController
def index
@objects =
params[:controller].singularize.camelize.constantize.find(params[..])
respond_to do |format|
format.html
format.xml { render :xml => @objects }
end
end
end
class NextController < UniversalTemplatesController
# Inherits from the universal_templates_controller
# no other code in here
end
class YetAnotherController < UniversalTemplatesController
# Inherits from the universal_templates_controller
# no other code in here
end
etc...
When these other controllers call what I showed you from within their
specific views, it works fine because they are all part of the
UniversalTemplatesController.
I'm not sure if this is what you were asking but it's another way of
doing things especially if you are reusing a lot of the same code within
other controllers.
--
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 [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
-~----------~----~----~----~------~----~------~--~---