Displaying 2 results from an estimated 2 matches for "genericcontroller".
2006 Jul 14
3
Accessing the Model class from Controller
Hi,
I wonder if there''s an easy way to access the associated Model class
from its Controller. Something that would allow me to write snippets
like the following:
class PeopleController < ApplicationController
def some_method
person_model_class =
self.some_method_to_retrieve_the_person_model_class()
end
end
Cheers,
Marco
--
Posted via
2009 Mar 17
11
Refactoring module
Dear all
Please see the following module, In module SX3 SX4 and SX5 have similar
class Tasklist, but inherit from different class.
I will use the following code to connect to different data sources
RemoteSX3Model.establish_connection sx3_hash
RemoteSX4Model.establish_connection sx4_hash
RemoteSX5Model.establish_connection sx5_hash
How can I refactor my code in module to look simpler? Thank you