Class: IshManager::LeadsetsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- IshManager::LeadsetsController
- Defined in:
- app/controllers/ish_manager/leadsets_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
alphabetized : ).
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
alphabetized : )
8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 8 def create @leadset = Leadset.new params[:leadset].permit! :create, @leadset if @leadset.save flash[:notice] = "created leadset" else flash[:alert] = "Cannot create leadset: #{@leadset.errors.}" end redirect_to :action => 'index' end |
#destroy ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 19 def destroy leadsets = Leadset.find( params[:leadset_ids] ) @results = [] leadsets.each do |leadset| @results.push leadset.discard end flash[:notice] = "Discard outcome: #{@results.inspect}." redirect_to action: 'index' end |
#edit ⇒ Object
29 30 31 32 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 29 def edit @leadset = Leadset.find params[:id] :edit, @leadset end |
#index ⇒ Object
34 35 36 37 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 34 def index :index, Leadset @leadsets = Leadset.all.kept # where( :profile => @current_profile, :is_trash => false ) end |
#new ⇒ Object
39 40 41 42 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 39 def new @new_leadset = Leadset.new :new, @new_leadset end |
#show ⇒ Object
44 45 46 47 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 44 def show :redirect, IshManager::Ability redirect_to :action => :edit, :id => params[:id] end |
#update ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 49 def update @leadset = Leadset.find params[:id] :update, @leadset if @leadset.update_attributes params[:leadset].permit! flash[:notice] = 'Successfully updated leadset.' else flash[:alert] = "Cannot update leadset: #{@leadset.errors.}" end redirect_to :action => 'index' end |