Created
February 27, 2017 11:12
-
-
Save leylaKapi/1fbf815f4f27e53190376ee89d8939f1 to your computer and use it in GitHub Desktop.
Filter according to categories
This file contains 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
@models = Model.joins(:categories).where('categories.id = ?', @categories_id).order("created_at DESC").paginate(page: params[:page]) | |
This file contains 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
- Category.all.each do |category| | |
%li.list-group-item | |
= link_to category.name, path(category: category.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment