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