lib/faceted/controller.rb in faceted-0.6.4 vs lib/faceted/controller.rb in faceted-0.7.0
- old
+ new
@@ -7,20 +7,20 @@
def render_response(obj)
render :json => {
success: obj.success,
response: obj.to_hash,
errors: obj.errors
- }.to_json
+ }
end
# For rendering a response with a multiple objects, e.g.
# render_response_with_collection(:addresses, @addresses)
def render_response_with_collection(key, array)
render :json => {
success: true,
response: {"#{key}".to_sym => array},
errors: nil
- }.to_json
+ }
end
# In your base API controller:
# rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
def render_400(exception)
\ No newline at end of file