Sha256: 5f8f93917a9fb94b9f8ea4a4c75cb1fe86da0c99e445368e9840cb20bd2a646d
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
class IshManager::EventsController < IshManager::ApplicationController before_action :set_lists def index authorize! :index, ::Event @events = Event.all end def new @event = Event.new authorize! :new, @event end def create @event = Event.new params[:event].permit! authorize! :create, @event if @event.save redirect_to :action => :index else flash[:alert] = @event.errors.messages render :action => :new end end def edit @event = Event.find params[:id] authorize! :edit, @event end def update @event = Event.find params[:id] authorize! :update, @event flag = @event.update_attributes params[:event].permit! if flag flash[:notice] = 'updated event' redirect_to :action => :index else flash[:alert] = "No luck: #{@event.errors.messages}" render :action => :edit end end def show @event = Event.find params[:id] authorize! :show, @event redirect_to :action => :edit, :id => @event.id end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ish_manager-0.1.8.132 | app/controllers/ish_manager/events_controller.rb |
ish_manager-0.1.8.131 | app/controllers/ish_manager/events_controller.rb |