Class: HydraEditor::ControllerResource
- Inherits:
-
CanCan::ControllerResource
- Object
- CanCan::ControllerResource
- HydraEditor::ControllerResource
- Defined in:
- lib/hydra_editor/controller_resource.rb
Instance Method Summary collapse
Instance Method Details
#find_resource ⇒ Object
2 3 4 |
# File 'lib/hydra_editor/controller_resource.rb', line 2 def find_resource ActiveFedora::Base.find(id_param) end |
#has_valid_type? ⇒ Boolean
11 12 13 |
# File 'lib/hydra_editor/controller_resource.rb', line 11 def has_valid_type? HydraEditor.valid_model? type_param end |
#resource_class ⇒ Object
6 7 8 9 |
# File 'lib/hydra_editor/controller_resource.rb', line 6 def resource_class raise HydraEditor::InvalidType, 'Lost the type' unless has_valid_type? type_param.constantize end |
#type_param ⇒ Object
15 16 17 |
# File 'lib/hydra_editor/controller_resource.rb', line 15 def type_param @params[:type] end |