
Untitled
By: a guest on
Apr 26th, 2012 | syntax:
None | size: 0.49 KB | hits: 19 | expires: Never
Stackoverflow-like Handling of Tag Filters for It's Discussion/Forum
resources :forums do
resources :forum_posts, :only => [:new, :edit, :create, :destroy]
match 'tagged/:name' => 'forums#tag', :as => 'forums_by_tag', :on => :collection
end
@forums = Forum.where(:forum_tags => {:name => params[:name]}).includes(:forum_tags).all
(a) @tags = @forums.forum_tags #doesn't work
(b) <%= link_to tagname, forums_by_tag_forum_path(params[:name]+'+'+tagname) %> #doesn't look right