I have a named route like the following:
map.with_options :path_prefix => '/:username', :controller => 'questions' do |q|
q.question '/:id', :action => 'show', :conditions => { :method => :get }
end
Now to generate a URL to a specific question I have to write
question_path( :id => @question.id, :username => @question.user.username )
Which is pretty cumbersome. I would like to be able to write
question_path(@question)
# or even
link_to 'Question', @question
and get the desired result.
How is this possible? I assume I have to overwrite the default helper to achieve this.