Sha256: 0f7bfa50c3a52a387aca970ceeeeab9861422ca78ceeecd3d11d7f6719ba3433

Contents?: true

Size: 614 Bytes

Versions: 8

Compression:

Stored size: 614 Bytes

Contents

class PassesKitsController < ApplicationController
  rescue_from CanCan::AccessDenied do |exception|
    flash[:alert] = exception.message
    redirect_to root_path, :alert => exception.message
  end

  before_filter do
    authorize! :edit, current_user.current_organization
  end

  def edit
    @kit = Kit.find(params[:id])
  end

  def update
    @kit = Kit.find(params[:id])

    if @kit.update_attributes(params[:passes_kit])
      redirect_to organization_path(@kit.organization)
    else
      flash[:error] = "We had a problem configuring your kit. Please try again."
      render :edit
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
artfully_ose-1.2.0 app/controllers/passes_kits_controller.rb
artfully_ose-1.2.0.beta.1 app/controllers/passes_kits_controller.rb
artfully_ose-1.2.0.alpha.2 app/controllers/passes_kits_controller.rb
artfully_ose-1.2.0.alpha.1 app/controllers/passes_kits_controller.rb
artfully_ose-1.2.0.pre.27 app/controllers/passes_kits_controller.rb
artfully_ose-1.2.0.pre.26 app/controllers/passes_kits_controller.rb
artfully_ose-1.2.0.pre.24 app/controllers/passes_kits_controller.rb
artfully_ose-1.2.0.pre.23 app/controllers/passes_kits_controller.rb