04 Nov '13, 10am

"blisteringly fast json"

Fast JSON APIs in Rails with Key-Based Caches and ActiveModel::Serializers Josh Clayton May 30, 2013 performance ruby on rails Want to make your Rails JSON APIs fast? Blisteringly fast? In a project I've been working on recently, I reduced requests from 5 seconds (or more!) to at most 0.5 seconds by using ActiveModel::Serializers and partial object caching with object composition. Before I explain how, I'll need to explain why . Partial Cacheability Imagine a Rails app that stores a handful of locations in a database: class Location < ActiveRecord::Base has_many :images has_many :categories geocoded_by :address after_validation :geocode end In this example, the Location model is using the geocoder gem to automatically geocode the model's address. To find all locations within 15 miles of Boston: Location.near('Boston', 15) This returns an ActiveRecord::Relation with each lo...

Full article: http://robots.thoughtbot.com/fast-json-apis-in-rails-with...

Tweets

Catching Invalid JSON Parse Errors with Rack Mi...

robots.thoughtbot.com 04 Nov '13, 10pm

Catching Invalid JSON Parse Errors with Rack Middleware Dan Collis-Puro November 04, 2013 rails json There is a world wher...

Catching Invalid JSON Parse Errors with Rack Mi...

rubyflow.com 04 Nov '13, 11pm

Catching Invalid JSON Parse Errors with Rack Middleware Posted by croaky on November 05, 2013 — 0 comments The middleware ...

A nice solution to a common problem from Though...

robots.thoughtbot.com 05 Nov '13, 2pm

Catching Invalid JSON Parse Errors with Rack Middleware Dan Collis-Puro November 04, 2013 rails json There is a world wher...

The trend for new courses in 2013? Firm and fast.

golfdigest.com 07 Nov '13, 11pm

It wasn't a boom, but it wasn't a bust either. The year in golf design started with a Streamsong splash and finishes with ...

Audit ActiveRecord models in rails 4

rubyflow.com 04 Nov '13, 3pm

Audit ActiveRecord models in rails 4 Posted by michelson on November 04, 2013 — 0 comments Audit activerecord models like ...

5 signs the energy sector is changing fast

5 signs the energy sector is changing fast

treehugger.com 08 Nov '13, 12pm

Perhaps one of the most exciting things about the current changes in the energy market is that this is no longer about ene...

Rails for Zombies

railsforzombies.org 04 Nov '13, 4pm

1 Intro 2 Learning about database tables 3 Reviewing Ruby Hashes 4 Creating new Tweets 5 Reading out of the database 6 Upd...

Implementing the Extended Process Similarity Re...

icann.org 06 Nov '13, 12am

On 27 June 2013 , the ICANN Board approved the proposed amendments to implement a two-panel process for string similarity ...

Writing Rails engine rspec controller tests #rails

pivotallabs.com 04 Nov '13, 6pm

If you are trying to test controllers under a Rails engine, you might come across this error: Failure/Error: get :index Ac...