include ActionState include ActionForm include ActionUpdate include ActionApi def set_redirect_path @create_redirect_path = users_path end end module Common::UsersController extend ActiveSupport::Concern included do crud_controller User, [:edit, :update] before_action :set_redirect_path end end
define_method :create_error_response_to do respond_to do |format| format.html { flash[:notify_error] = "࡞Ͱ͖·ͤΜͰͨ͠" create_error_response_to_html } format.json { create_error_response_to_json } end end define_method :create_error_response_to_html do render self.class.instance_variable_get(:@_create_error_action) || :new end define_method :create_error_response_to_json do render json: { errors: instance_variable_get("@#{model_name}").errors.full_messages }, status: 422 end end