Sha256: 9178f8582aef506c1dc235d714cc47dd99bcb3effc41b0ad7533a17cdc5cfd11

Contents?: true

Size: 949 Bytes

Versions: 9

Compression:

Stored size: 949 Bytes

Contents

class ExceptionsController < ApplicationController
  def index
    @exceptions = <%= class_name %>.all(:select => '*, COUNT(*) as count', :group => 'group_id', :order => 'created_at DESC')
  end

  def details
    @exceptions = <%= class_name %>.paginate(:all, :conditions => { :group_id => params[:id] }, :order => 'created_at DESC', :page => params[:page], :per_page => 1)
    @exception = @exceptions.first
  end

  def remove_all
    <%= class_name %>.delete_all
    redirect_to :action => :index
  end

  def remove_group
    <%= class_name %>.delete_all(:group_id => params[:id])
    redirect_to :action => :index
  end

  def remove_individual
    exception = <%= class_name %>.find_by_id(params[:id])
    exception.destroy

    if <%= class_name %>.count(:conditions => { :group_id => exception.group_id }).zero?
      redirect_to :action => :index
    else
      redirect_to :action => :details, :id => exception.group_id
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tartarus-2.3 lib/generators/tartarus/templates/app/controllers/exceptions_controller.rb
tartarus-2.2 lib/generators/tartarus/templates/app/controllers/exceptions_controller.rb
tartarus-2.0.4 lib/generators/tartarus/templates/app/controllers/exceptions_controller.rb
tartarus-2.0.3 lib/generators/tartarus/templates/app/controllers/exceptions_controller.rb
tartarus-2.0.1 lib/generators/tartarus/templates/app/controllers/exceptions_controller.rb
tartarus-2.0.0 lib/generators/tartarus/templates/app/controllers/exceptions_controller.rb
tartarus-1.0.3 generators/tartarus/templates/app/controllers/exceptions_controller.rb
tartarus-1.0.1 generators/tartarus/templates/app/controllers/exceptions_controller.rb
tartarus-1.0.0 generators/tartarus/templates/app/controllers/exceptions_controller.rb