Here is my controller
before_action :seo_url_product,only: :product
def seo_url_product
if params[:id]
@posts = Post.friendly.where(sub_category_id: params[:id]).paginate(page: params[:page], per_page: 2).to_a
end
end
Here is my view
<% category.sub_categories.each do |sub_category| %>
<li><%= link_to sub_category.name, controller: :posts, action: :product, id: sub_category %></li>
<% end %>
I can see friendly url when i click sub_categories but i could not see any result.