Module: GetsKlass
- Extended by:
- ActiveSupport::Concern
- Included in:
- RestArea::MessageController, RestArea::RestController
- Defined in:
- app/controllers/concerns/gets_klass.rb
Instance Method Summary collapse
Instance Method Details
#get_klass ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/concerns/gets_klass.rb', line 8 def get_klass rescue_uninitialized_constant do klass = params[:klass].classify.constantize @resource = RestArea.resources[klass.name.underscore.to_sym] @klass = @resource.klass end test_class(@klass) @roots = ActionController::Base.helpers.sanitize(params[:klass]).pluralize @root = @roots.singularize end |