Rails: Specifing params without value to link_to
问题 Supposing the route map.resources :articles how do you get this /articles?most_popular using link_to method? tried the following: link_to articles_path(:most_popular) # exception link_to articles_path(:most_popular => nil) # /articles link_to articles_path(:most_popular => true) # /articles?most_popular=true note: i'm using inherited_resources with has_scope 回答1: If you don't add a value to the parameters you will not be respecting the W3C standard, which mandates that the params section has