Fix bugs.(Add filter_by_tags and Add criteria_title to index)
This commit is contained in:
parent
c028b62f05
commit
e46db67df3
|
@ -7,6 +7,7 @@ class Admin::EPapersController < OrbitAdminController
|
|||
@filter_fields.delete(:status)
|
||||
@papers = EPaperTopic.order_by(sort)
|
||||
.with_categories(filters("category"))
|
||||
.with_tags(filters("tag"))
|
||||
|
||||
|
||||
@papers = search_data(@papers,[:title]).page(params[:page]).per(10)
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
class EPapersController < ApplicationController
|
||||
|
||||
def index
|
||||
topics = EPaperTopic.filter_by_categories.desc(:period)
|
||||
topics = EPaperTopic.filter_by_categories.filter_by_tags.desc(:period)
|
||||
data = topics.collect do |topic|
|
||||
{
|
||||
"title" => topic.title,
|
||||
"criteria_title" => topic.criteria_title,
|
||||
"link_to_show" => OrbitHelper.url_to_show(topic.to_param),
|
||||
"description" => topic.description,
|
||||
"img_url" => topic.image.url,
|
||||
|
@ -144,7 +145,7 @@ class EPapersController < ApplicationController
|
|||
end
|
||||
|
||||
def category_wise_articles
|
||||
topics = EPaperTopic.filter_by_widget_categories.desc(:period)
|
||||
topics = EPaperTopic.filter_by_widget_categories.filter_by_tags(OrbitHelper.widget_tags).desc(:period)
|
||||
data = Array(topics).compact.collect do |topic|
|
||||
{
|
||||
"title" => topic.title,
|
||||
|
|
Loading…
Reference in New Issue