-
-
Save motephyr/d284942c224bad09d7b5871f075bdad9 to your computer and use it in GitHub Desktop.
Vue.js 處理Rails data的filter-controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
def index | |
@topics = Topic.joins(:topic_category).select('topics.id','topics.title_zh','topics.title_en','topics.topic_messages_count','topics.created_at','topic_categories.meta_key','topic_categories.name_zh','topic_categories.name_en') | |
.order("topics.created_at desc").page(params[:page]).per(10) | |
@topic_categories = TopicCategory.order("order_date desc") | |
end | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment