Module: Controller::Actions::Create
- Defined in:
- lib/resourcify/controller/actions/create.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/resourcify/controller/actions/create.rb', line 3 def create @record = _RC.new(permitted_params) @record if @record.save render json: @record else @error[:type] = 'Validation' @error[:message] = 'Sorry, there were validation errors.' @error[:errors] = @record.errors. @error[:messages] = @record.errors. render json: @error end end |