In my config/routes.rb I have:
map.resources :discussions
But I can’t generate proper URLs:
discussions_path(:format => :xml) -> /discussions?format=xml instead
of /discussions.xml
discussion_path(discussion, :format => :xml) -> “You have a nil object
when you didn’t expect it! The error occurred while evaluating
nil.to_sym”
discussion_path(discussion, :format => :xml) -> /discussions/1?
format=xml instead of /discussions/1.xml
What gives here? Am I calling the route generation wrong? Is there
something I need to add to my routes? Can anyone give me an example of
how to generate the urls correctly?