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