How can I set default parameter value in routing in Rails 3. For example I have this route
match ':slug/:id/:direction' => 'quiz#show', :as => :quiz_details, :direction => "next"
and I want to default the value of direction to next
.
How can I set default parameter value in routing in Rails 3. For example I have this route
match ':slug/:id/:direction' => 'quiz#show', :as => :quiz_details, :direction => "next"
and I want to default the value of direction to next
.
match ':slug/:id/:direction' => 'quiz#show', :as => :quiz_details, :defaults => { :direction => "next" }
More details in the official Rails guides.