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