Skip to content

Instantly share code, notes, and snippets.

@itsmikeq
Last active November 11, 2015 22:44
Show Gist options
  • Save itsmikeq/d422afbfc4c6f74d957e to your computer and use it in GitHub Desktop.
Save itsmikeq/d422afbfc4c6f74d957e to your computer and use it in GitHub Desktop.
fix %2F's in rails > 4.1.2
# Fix routes with /'s that are switched to %2F in > rails 4.1.1
# put in config/initializers/
module ActionDispatch
module Journey
class Router
class Utils
class UriEncoder
def escape_segment(segment)
# dont jack up URLs and turn the /'s into %2F's
URI.decode(escape(segment, SEGMENT))
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment