Sha256: 6fe2a2e7bf411639486b0e54a8ddb511b89eddc373a4def71466b979a4c27ced

Contents?: true

Size: 636 Bytes

Versions: 13

Compression:

Stored size: 636 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.open
    @closed_inquiries = Inquiry.closed
    @inquiries = @open_inquiries
  end

end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
jacobat-refinerycms-0.9.6.14 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.19 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.18 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.17 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.16 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.15 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.14 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.13 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.12 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.11 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.10 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.9 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb
refinerycms-0.9.6.8 vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb