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.82 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.81 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.80 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.79 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.78 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.77 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.76 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.75 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.74 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.73 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.72 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.71 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.70 app/controllers/ish_manager/leads_controller.rb
ish_manager-0.1.8.69 app/controllers/ish_manager/leads_controller.rb