Sha256: 631a8eeffa8876582a82939a5ad71a1e62698ea82ad144ab281d1350116d7f56

Contents?: true

Size: 952 Bytes

Versions: 54

Compression:

Stored size: 952 Bytes

Contents

class IshManager::LeadsController < IshManager::ApplicationController

  def index
    authorize! :index, Ish::Lead
    @leads = Ish::Lead.where( :profile => current_user.profile )
  end

  def new
    @new_lead = Ish::Lead.new
    authorize! :new, @new_lead
  end

  def create
    @lead = Ish::Lead.new params[:lead].permit!
    @lead.profile = current_user.profile
    authorize! :create, @lead
    if @lead.save
      flash[:notice] = "created lead"
    else
      flash[:alert] = "Cannot create lead: #{@lead.errors.messages}"
    end
    redirect_to :action => 'index'
  end

=begin
  def update
    @invoice = Ish::Invoice.find params[:id]
    authorize! :update, @invoice
    if @invoice.update_attributes params[:invoice].permit!
      flash[:notice] = 'Success'
      redirect_to :action => 'index'
    else
      flash[:alert] = "Cannot update invoice: #{@invoice.errors.messages}"
    end
    redirect_to :action => 'index'
  end
=end

end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
ish_manager-0.1.8.122 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.121 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.120 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.119 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.118 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.117 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.116 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.115 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.114 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.113 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.112 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.111 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.110 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.109 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.108 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.107 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.106 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.105 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.104 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.103 app/controllers/ish_manager/leads_controller.rb