Method: ClassificationsController#create

Defined in:
app/controllers/classifications_controller.rb

#createObject

POST /classifications POST /classifications.json



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'app/controllers/classifications_controller.rb', line 69

def create
  @classification = Classification.new(classification_params)

  respond_to do |format|
    if @classification.save
      format.html { redirect_to @classification, notice: t('controller.successfully_created', model: t('activerecord.models.classification')) }
      format.json { render json: @classification, status: :created, location: @classification }
    else
      @classification_types = ClassificationType.all
      format.html { render action: "new" }
      format.json { render json: @classification.errors, status: :unprocessable_entity }
    end
  end
end