Class: Dune::Admin::ChannelsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/dune/admin/channels_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.channel_actionsObject



18
19
20
21
22
23
24
25
26
# File 'app/controllers/dune/admin/channels_controller.rb', line 18

def self.channel_actions
  %w[push_to_draft push_to_online].each do |action|
    define_method action do
      resource.send(action)
      flash.notice = I18n.t("dune.admin.channels.messages.successful.#{action}")
      redirect_to channels_path(params[:local_params])
    end
  end
end

Instance Method Details

#createObject



6
7
8
# File 'app/controllers/dune/admin/channels_controller.rb', line 6

def create
  create! { channels_path }
end

#destroyObject



14
15
16
# File 'app/controllers/dune/admin/channels_controller.rb', line 14

def destroy
  destroy! { channels_path }
end

#updateObject



10
11
12
# File 'app/controllers/dune/admin/channels_controller.rb', line 10

def update
  update! { channels_path }
end