Class: Hydramata::GroupsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Hydramata::GroupsController
- Includes:
- Blacklight::Catalog, Hydra::AccessControlsEnforcement, Hydra::Controller::ControllerBehavior, GroupMembershipActionParser, Sufia::Noid
- Defined in:
- app/controllers/hydramata/groups_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/hydramata/groups_controller.rb', line 32 def create @group_membership = Hydramata::GroupMembershipForm.new( Hydramata::GroupMembershipActionParser.convert_params(params, current_user) ) if @group_membership.save flash[:notice] = "Group created successfully." redirect_to hydramata_groups_path else flash[:error] = "Group was not created." render action: :new end end |
#destroy ⇒ Object
60 61 62 63 64 |
# File 'app/controllers/hydramata/groups_controller.rb', line 60 def destroy title = @group.to_s @group.destroy after_destroy_response(title) end |
#edit ⇒ Object
43 44 45 46 47 |
# File 'app/controllers/hydramata/groups_controller.rb', line 43 def edit @group = Hydramata::Group.find( params[:id] ) setup_form respond_with(@group) end |
#index ⇒ Object
23 24 25 |
# File 'app/controllers/hydramata/groups_controller.rb', line 23 def index super end |
#new ⇒ Object
27 28 29 30 |
# File 'app/controllers/hydramata/groups_controller.rb', line 27 def new @group = Hydramata::Group.new setup_form end |
#update ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'app/controllers/hydramata/groups_controller.rb', line 49 def update @group_membership = Hydramata::GroupMembershipForm.new( Hydramata::GroupMembershipActionParser.convert_params(params, current_user) ) if @group_membership.save flash[:notice] = "Group updated successfully." redirect_to hydramata_group_path( params[:id] ) else flash[:error] = "Group was not updated." render action: :edit end end |