Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
weird error I'm seeing in staging
# controller (dumbed down version)
def email_aircraft
return unless request.post?
@request = Request.new(params[:request])
respond_to do |format|
if @request.valid?
flash[:success] = "Your message was successfully sent."
format.html { redirect_to aircraft_url(@aircraft) }
format.js
else
flash[:error] = AppConfig["error_message"]
format.html { redirect_to :back }
format.js
end
end
end
# email_aircraft.js.erb
$("#ajax-response").html("<%= escape_javascript(error_messages_for :request, :header_message => 'Errors were encountered in your request') %>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.