mirror of
https://git.sr.ht/~edwardloveall/scribe
synced 2025-12-10 12:41:23 +00:00
Link to full Medium URL on error page
Previously the link on the error page was only linking to the path component of the url, e.g. `/search` but ignoring any query params e.g. `/search?q=hello`. This uses the HTTP::Request `resource` method which appears to capture both.
This commit is contained in:
@@ -12,8 +12,8 @@ class Articles::Show < BrowserAction
|
||||
html(
|
||||
Errors::ParseErrorPage,
|
||||
message: "Error parsing the URL",
|
||||
status_code: 500,
|
||||
original_path: request.path,
|
||||
status_code: 422,
|
||||
original_resource: request.resource,
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Errors::ParseErrorPage < MainLayout
|
||||
needs message : String
|
||||
needs status_code : Int32
|
||||
needs original_path : String
|
||||
needs original_resource : String
|
||||
|
||||
def page_title
|
||||
"Error"
|
||||
@@ -25,7 +25,7 @@ class Errors::ParseErrorPage < MainLayout
|
||||
TEXT
|
||||
para do
|
||||
text "If you like, you can try visiting "
|
||||
a "this page on medium.com", href: "https://medium.com#{original_path}"
|
||||
a "this page on medium.com", href: "https://medium.com#{original_resource}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user