|
|
|
@ -1,14 +1,5 @@
|
|
|
|
|
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 :check_user_permission!
|
|
|
|
|
|
|
|
|
|