Class: Postablr::BlogController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Postablr::BlogController
- Defined in:
- app/controllers/postablr/blog_controller.rb
Instance Method Summary collapse
Instance Method Details
#filter ⇒ Object
10 11 12 13 |
# File 'app/controllers/postablr/blog_controller.rb', line 10 def filter @entries = Postablr::Entry.includes(:postable).published.where("postablr_entries.postable_type =?", "Entry::#{params[:filter].capitalize}").order("postablr_entries.created_at desc").page(params[:page]).per(6) render :show end |
#show ⇒ Object
6 7 8 |
# File 'app/controllers/postablr/blog_controller.rb', line 6 def show @entries = Postablr::Entry.includes(:postable).published.order("postablr_entries.postable_type.created_at desc").page(params[:page]).per(6) end |
#tags_get ⇒ Object
15 16 17 18 19 |
# File 'app/controllers/postablr/blog_controller.rb', line 15 def @q = params[:tag] @tags = ActsAsTaggableOn::Tag.where{( name =~ "#{@q}%")} render :json=> @tags.collect{ |tag| {"caption"=> tag.name, "value"=>tag.id.to_s } } end |