Sha256: 49de56a067cb87390a86ec4557ca6cd3eb8be995c349ccfcde0177fa4017a371

Contents?: true

Size: 913 Bytes

Versions: 14

Compression:

Stored size: 913 Bytes

Contents

class IshManager::VenuesController < IshManager::ApplicationController

  before_action :set_lists

  def index
    authorize! :index, Venue
    @venues = Venue.all
  end

  def new
    @venue = Venue.new
    authorize! :new, @venue
  end

  def create
    @venue = Venue.new params[:venue].permit!
    authorize! :create, @venue
    if @venue.save
      redirect_to :action => :index
    else
      flash[:alert] = @venue.errors.messages
      render :action => :new
    end
  end

  def edit
    @venue = Venue.find params[:id]
    authorize! :edit, @venue
  end

  def update
    @venue = Venue.find params[:id]
    authorize! :update, @venue

    flag = @venue.update_attributes params[:venue].permit!
    if flag
      flash[:notice] = 'updated venue'
      redirect_to :action => :index
    else
      flash[:alert] = "No luck: #{@venue.errors.messages}"
      render :action => :edit
    end
  end

end


Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ish_manager-0.1.8.36 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.35 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.34 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.33 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.32 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.31 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.30 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.29 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.28 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.27 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.26 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.25 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.24 app/controllers/ish_manager/venues_controller.rb
ish_manager-0.1.8.23 app/controllers/ish_manager/venues_controller.rb