Skip to content

Instantly share code, notes, and snippets.

@namusyaka
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save namusyaka/87c6cd9d4904dfad95b2 to your computer and use it in GitHub Desktop.
Save namusyaka/87c6cd9d4904dfad95b2 to your computer and use it in GitHub Desktop.
diff --git a/Gemfile b/Gemfile
index aa19617..fa847b7 100644
--- a/Gemfile
+++ b/Gemfile
@@ -21,6 +21,7 @@ gem 'slim'
# Padrino Stable Gem
gem 'padrino', '0.12.2'
+gem 'rack-parser'
# Or Padrino Edge
# gem 'padrino', :github => 'padrino/padrino-framework'
diff --git a/app/app.rb b/app/app.rb
index 606e221..3daefb4 100644
--- a/app/app.rb
+++ b/app/app.rb
@@ -4,6 +4,7 @@ module First
register Padrino::Helpers
enable :sessions
+ use Rack::Parser, parsers: { 'application/json' => proc{|data| JSON.parse(data) } }
##
# Caching support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment