Created
April 11, 2014 01:42
-
-
Save heptat/10436561 to your computer and use it in GitHub Desktop.
rails 4.1 JSON API problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Metal | |
include ActionController::Helpers | |
include ActionController::Redirecting | |
# Rendering MUST be before Renderers::All | |
include AbstractController::Rendering | |
include ActionController::Renderers::All | |
# this is now in ActionView::Layouts: | |
# include AbstractController::Layouts | |
include ActionView::Layouts | |
include ActionController::ConditionalGet | |
include ActionController::MimeResponds | |
include ActionController::RequestForgeryProtection # not sure I need this | |
include ActionController::ForceSSL | |
include AbstractController::Callbacks | |
include ActionController::Instrumentation | |
include ActionController::ParamsWrapper | |
include ActionController::StrongParameters | |
include ActionController::Serialization # for active_model_serializers | |
include Rails.application.routes.url_helpers | |
# some stuff | |
end | |
class VouchersController | |
respond_to :json | |
def update | |
# do some stuff | |
render json: response.to_json, status: 422 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment