Fixing record_js_error - ActionController::InvalidByteSequenceErrorFromParams

Pull request to fix the issue #368.