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 : ).
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
alphabetized : )
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 6 def create @leadset = Leadset.new params[:leadset].permit! @leadset.profile = @current_profile :create, @leadset if @leadset.save flash[:notice] = "created leadset" else flash[:alert] = "Cannot create leadset: #{@leadset.errors.}" end redirect_to :action => 'index' end |
#edit ⇒ Object
18 19 20 21 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 18 def edit @leadset = Leadset.find params[:id] :edit, @leadset end |
#index ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 23 def index :index, Leadset @leadsets = Leadset.all # where( :profile => @current_profile, :is_trash => false ) # if params[:is_done] # @leadsets = @leadsets.where( :is_done => true ) # else # @leadsets = @leadsets.where( :is_done => false ) # end end |
#new ⇒ Object
33 34 35 36 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 33 def new @new_leadset = Leadset.new :new, @new_leadset end |
#show ⇒ Object
38 39 40 41 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 38 def show :redirect, IshManager::Ability redirect_to :action => :edit, :id => params[:id] end |
#update ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/ish_manager/leadsets_controller.rb', line 43 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 |