Skip to content

Instantly share code, notes, and snippets.

@vjousse

vjousse/post.cr Secret

Created Sep 8, 2020
Embed
What would you like to do?
require "markd"
class Blog::Post < BrowserAction
include Auth::AllowGuests
get "/blog/:post_slug" do
file_content = File.read("content/fr/#{post_slug}.md")
html Blog::PostPage, title: post_slug, html_content: html_content
end
end
# URL http://localhost:3001/blog/2012-11-05-recrutement-développeur-web-comment-sortir-du-lot-cv-lettre-de-motivation
# gives the value `2012-11-05-recrutement-d%C3%A9veloppeur-web-comment-sortir-du-lot-cv-lettre-de-motivation` inside the variable post_slug
# this seems pretty normal to me. Any way to "unescap" the `é` character to get it bakc from the `%C3%A9` entity?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment