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