Sha256: 4bf523b125df9c2cefe658f67916f9d1ab255197b349ef819fd721ef9bce3ba7
Contents?: true
Size: 638 Bytes
Versions: 5
Compression:
Stored size: 638 Bytes
Contents
module Tim class CustomResponder < ActionController::Responder # We want different API Behaviour than in default renderer def api_behavior(error) raise error unless resourceful? status = :ok begin if get? then display resource elsif post? status = :created controller.render :status => status, :action => "show" elsif put? controller.render :status => :ok, :action => "show" else head :no_content end rescue ActionView::MissingTemplate => e display resource, :status => status end end end end
Version data entries
5 entries across 5 versions & 1 rubygems