16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/controllers/curation_concerns/classify_concerns_controller.rb', line 16
def create
classify_concern.attributes = params[:classify_concern]
if classify_concern.valid?
respond_to do |wants|
wants.html do
redirect_to new_polymorphic_path(
[:curation_concerns, classify_concern.curation_concern_class]
)
end
wants.json { render_json_response(response_type: :created, options: { location: polymorphic_path([main_app, :curation_concerns, curation_concern]) }) }
end
else
respond_to do |wants|
wants.html { render 'new', status: :unprocessable_entity }
wants.json { render_json_response(response_type: :unprocessable_entity, message: curation_concern.errors.messages) }
end
end
end
|