mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: apply defaults constraints to routes format (#7890)
This fixes the problem where if a route ends with a dynamic segment and the segment contains a period e.g. `my.name`, `name` is interpreted as the format. This applies a default format constraints `/(json|html)/` on all routes. If you'd like a route to have a different format constraints, you can do something like this:
```ruby
get "your-route" => "your_controlller#method", constraints: { format: /(rss|xml)/ }
#or
get "your-route" => "your_controlller#method", constraints: { format: :xml }
```
This commit is contained in:
@@ -1065,7 +1065,10 @@ class UsersController < ApplicationController
|
||||
@confirmed = true
|
||||
end
|
||||
|
||||
render layout: 'no_ember'
|
||||
respond_to do |format|
|
||||
format.json { render json: success_json }
|
||||
format.html { render layout: 'no_ember' }
|
||||
end
|
||||
end
|
||||
|
||||
def list_second_factors
|
||||
|
||||
Reference in New Issue
Block a user