Sha256: 028f6dc9d6f27b300dccda4b5f2a867d247b124453e28e94416d66ac058f5d1e

Contents?: true

Size: 642 Bytes

Versions: 28

Compression:

Stored size: 642 Bytes

Contents

class Admin::InquiriesController < Admin::BaseController

  crudify :inquiry, :title_attribute => "name", :order => "created_at DESC"

  before_filter :find_inquiry, :only => [:show, :toggle_status, :destroy]
  before_filter :find_all_inquiries, :only => [:index]
  
  def toggle_status
    @inquiry.toggle!(:open)

    flash[:notice] = "'#{@inquiry.name}' has been " + 
    if @inquiry.open?
      "reopened"
    else
      "closed"
    end

    redirect_to :action => 'index'
  end

protected

  def find_all_inquiries
    @open_inquiries = Inquiry.opened
    @closed_inquiries = Inquiry.closed
    @inquiries = @open_inquiries
  end
  
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
refinerycms-0.9.5.13 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.12 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.11 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.10 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.9 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.8 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.7 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.6 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.5 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.4 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.3 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.2 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5.1 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.5 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.4.5 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.4.4 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.4.3 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.4.2 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.4.1 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.4 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb