fix trial apply

dev_course
p31729568 5 years ago
parent 3f3f7ed854
commit 508d24af2c

@ -12,5 +12,8 @@ module ControllerRescueHandler
rescue_from ActiveModel::ValidationError do |ex| rescue_from ActiveModel::ValidationError do |ex|
render_error(ex.model.errors.full_messages.join(',')) render_error(ex.model.errors.full_messages.join(','))
end end
rescue_from ActiveRecord::RecordInvalid do |ex|
render_error(ex.record.errors.full_messages.join(','))
end
end end
end end

@ -1,14 +1,5 @@
class Ecs::BaseController < ApplicationController class Ecs::BaseController < ApplicationController
# model validation error
rescue_from ActiveRecord::RecordInvalid do |ex|
render_error(ex.record.errors.full_messages.join(','))
end
# form validation error
rescue_from ActiveModel::ValidationError do |ex|
render_error(ex.model.errors.full_messages.join(','))
end
before_action :require_login before_action :require_login
before_action :check_user_permission! before_action :check_user_permission!

Loading…
Cancel
Save