Class: IshManager::LeadsetTagsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ish_manager/leadset_tags_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#basic_auth, #home, #tinymce

Instance Method Details

#createObject

params[ :leadset_id, :term_id, ]



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/ish_manager/leadset_tags_controller.rb', line 5

def create
  authorize! :leadset_tags_create, ::IshManager

  lt = LeadsetTag.new( leadset_id: params[:leadset_id], term_id: params[:term_id] )
  flag = lt.save
  if flag
    flash[:notice] = 'Success'
  else
    flash[:alert] = "No luck: #{lt.errors.full_messages.join(', ')}"
  end
  redirect_to request.referrer ? request.referrer : leadsets_path
end