Class: Channels::ChannelsSubscribersController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/channels/channels_subscribers_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject Also known as: index



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/channels/channels_subscribers_controller.rb', line 9

def create
  begin
    create! do |success,failure|
      success.html{
        flash[:notice] = I18n.t('channels_subscribers.created')
        return redirect_to root_path }
    end
  rescue PG::Error, ActiveRecord::RecordNotUnique => e
    return redirect_to root_path
  end
end

#destroyObject



22
23
24
25
26
27
28
29
# File 'app/controllers/channels/channels_subscribers_controller.rb', line 22

def destroy
  destroy! do |success,failure|
    success.html{
      flash[:notice] = I18n.t('channels_subscribers.deleted')
      return redirect_to root_path
    }
  end
end