Adds JS response support to #render_error (#15760).
git-svn-id: http://svn.redmine.org/redmine/trunk@12855 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
171581da7e
commit
3d64938adc
|
@ -431,6 +431,10 @@ class ApplicationController < ActionController::Base
|
|||
format.html {
|
||||
render :template => 'common/error', :layout => use_layout, :status => @status
|
||||
}
|
||||
format.js {
|
||||
# Can't use an error status here, browsers wouldn't execute the JS response
|
||||
render :template => 'common/error', :layout => false, :status => 200
|
||||
}
|
||||
format.any { head @status }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
alert("<%= raw escape_javascript @message %> (<%= raw escape_javascript @status.to_s %>)");
|
Loading…
Reference in New Issue