Sha256: add8119ed8a633d4db2d9e31a72bf8b99d8b1703fb3f693caac7640a752b737d

Contents?: true

Size: 1014 Bytes

Versions: 18

Compression:

Stored size: 1014 Bytes

Contents

class Forge::EventsController < ForgeController
  load_and_authorize_resource
  before_filter :uses_ckeditor, :only => [:edit, :update, :new, :create]
  

  def index
    respond_to do |format|
      format.html { @events = Event.paginate(:per_page => 10, :page => params[:page]) }
      format.js { 
        @events = Event.where("title LIKE ?", "%#{params[:q]}%")
        render :partial => "event", :collection => @events
      }
    end
  end

  def new
    @event = Event.new
  end

  def edit
  end

  def create
    @event = Event.new(params[:event])
    if @event.save
      flash[:notice] = 'Event was successfully created.'
      redirect_to(forge_events_path)
    else
      render :action => "new"
    end
  end

  def update
    if @event.update_attributes(params[:event])
      flash[:notice] = 'Event was successfully updated.'
      redirect_to(forge_events_path)
    else
      render :action => "edit"
    end
  end

  def destroy
    @event.destroy
    redirect_to(forge_events_path)
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
forge-cli-0.1.4 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.1.3 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.1.2 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.1.1 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.1.0 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.18 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.17 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.16 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.15 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.14 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.13 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.12 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.11 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.10 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.9 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.8 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.7 lib/forge/app/controllers/forge/events_controller.rb
forge-cli-0.0.6 lib/forge/app/controllers/forge/events_controller.rb