Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 0.49 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Stackoverflow-like Handling of Tag Filters for It's Discussion/Forum
  2. resources :forums do    
  3.   resources :forum_posts, :only => [:new, :edit, :create, :destroy]    
  4.   match 'tagged/:name' => 'forums#tag', :as => 'forums_by_tag', :on => :collection    
  5. end
  6.        
  7. @forums = Forum.where(:forum_tags => {:name => params[:name]}).includes(:forum_tags).all
  8.        
  9. (a) @tags = @forums.forum_tags #doesn't work
  10.  
  11. (b) <%= link_to tagname, forums_by_tag_forum_path(params[:name]+'+'+tagname) %> #doesn't look right