app/controllers/apicasso/crud_controller.rb in apicasso-0.5.2 vs app/controllers/apicasso/crud_controller.rb in apicasso-0.6.0
- old
+ new
@@ -14,19 +14,17 @@
# the ones that have a `domain` that matches exactly `"domain.com"`,
# paginating records 42 per page and retrieving the page 42.
# Example:
# GET /sites?sort=+name,-updated_at&q[domain_eq]=domain.com&page=42&per_page=42
def index
- set_access_control_headers
render json: index_json
end
# GET /:resource/1
# Common behavior for showing a record, with an addition of
# relation/methods including on response
def show
- set_access_control_headers
render json: show_json
end
# PATCH/PUT /:resource/1
# Common behavior for an update API endpoint
@@ -73,10 +71,10 @@
# OPTIONS /:resource
# OPTIONS /:resource/1/:nested_resource
# Will return a JSON with the schema of the current resource, using
# attribute names as keys and attirbute types as values.
def schema
- render json: resource_schema.to_json unless preflight?
+ render json: resource_schema.to_json
end
private
# Common setup to stablish which object this request is querying