Class: IshManager::CategoriesController
Instance Method Summary
collapse
#basic_auth, #home, #tinymce
Instance Method Details
#create_email_tag ⇒ Object
25
26
27
28
29
30
|
# File 'app/controllers/ish_manager/categories_controller.rb', line 25
def create_email_tag
@tag = WpTag.emailtag( params[:tag][:name] )
authorize! :create, @tag
@tag.persisted? ? flash_notice('persisted') : flash_alert('cannot save tag')
redirect_to request.referrer ? request.referrer : email_conversations_path
end
|
#index ⇒ Object
6
7
8
9
10
11
|
# File 'app/controllers/ish_manager/categories_controller.rb', line 6
def index
authorize! :categories_index, IshManager::Ability
@categories_flat = Category.all_flat
@tags = Category.all_tags
end
|
#show ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/ish_manager/categories_controller.rb', line 13
def show
@category = WpTag.find params[:id]
authorize! :show, @category
@leads = @category.leads
if params[:q].present?
@leads = @leads.where(" email LIKE ? ", "%#{params[:q]}%" )
end
@leads = @leads.page( params[:leads_page] ).per( current_profile.per_page )
end
|