Skip to content

Instantly share code, notes, and snippets.

View sdeboer's full-sized avatar

Simon de Boer sdeboer

View GitHub Profile
@sdeboer
sdeboer / ExampleProfileController
Last active December 11, 2015 14:08
A very thin abstract class for fast rails responses
class ExampleProfileController < MetalController
# assuming a route something like:
# /profile/:user_id.json
def show
prof = Profile.find params['user_id']
if prof
respond_with prof
else
response_error 'not_found', "User id of #{params['user_id']} has not been found."
end