Skip to content

Instantly share code, notes, and snippets.

@domagude
Last active October 31, 2017 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domagude/9a311069e6a7a0eaa8cefb4f11b82748 to your computer and use it in GitHub Desktop.
Save domagude/9a311069e6a7a0eaa8cefb4f11b82748 to your computer and use it in GitHub Desktop.
<% branch_path_name = "#{params[:action]}_posts_path" %>
<div class="col-sm-12">
<ul class="categories-list">
<%= render all_categories_button_partial_path,
branch_path_name: branch_path_name %>
<% @categories.each do |category| %>
<li class="category-item">
<%= link_to category.name,
send(branch_path_name, category: category.name),
:class => ("selected-item" if params[:category] == category.name) %>
</li>
<% end %>
</ul>
</div><!-- col-sm-12 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment