Class: Plugins::CamaSubscriber::GroupsController
- Inherits:
-
AdminController
- Object
- AdminController
- Plugins::CamaSubscriber::GroupsController
- Defined in:
- app/controllers/plugins/cama_subscriber/groups_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
11 12 13 14 15 |
# File 'app/controllers/plugins/cama_subscriber/groups_controller.rb', line 11 def create @item = current_site.subscriber_groups.create(item_params) flash[:notice] = t('.saved', default: 'The group was saved') redirect_to action: :index end |
#destroy ⇒ Object
33 34 35 36 37 |
# File 'app/controllers/plugins/cama_subscriber/groups_controller.rb', line 33 def destroy @item = current_site.subscriber_groups.find(params[:id]).destroy flash[:notice] = t('.destroyed', default: 'The group was destroyed') redirect_to action: :index end |
#edit ⇒ Object
17 18 19 20 |
# File 'app/controllers/plugins/cama_subscriber/groups_controller.rb', line 17 def edit @item ||= current_site.subscriber_groups.find(params[:id]) render 'form', layout: false end |
#index ⇒ Object
2 3 4 |
# File 'app/controllers/plugins/cama_subscriber/groups_controller.rb', line 2 def index @items = current_site.subscriber_groups end |
#new ⇒ Object
6 7 8 9 |
# File 'app/controllers/plugins/cama_subscriber/groups_controller.rb', line 6 def new @item = current_site.subscriber_groups.new render 'form', layout: false end |
#show ⇒ Object
28 29 30 31 |
# File 'app/controllers/plugins/cama_subscriber/groups_controller.rb', line 28 def show @item = current_site.subscriber_groups.find(params[:id]) render layout: false end |
#update ⇒ Object
22 23 24 25 26 |
# File 'app/controllers/plugins/cama_subscriber/groups_controller.rb', line 22 def update @item = current_site.subscriber_groups.find(params[:id]).update(item_params) flash[:notice] = t('.updated', default: 'The group was udpated') redirect_to action: :index end |