Class: CurationConcerns::ClassifyConcernsController

Inherits:
ApplicationController show all
Includes:
ThemedLayoutController
Defined in:
app/controllers/curation_concerns/classify_concerns_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ThemedLayoutController

#show_site_actions?, #show_site_search?

Methods included from ApplicationControllerBehavior

#deny_access, #render_404, #render_json_response

Instance Attribute Details

#classify_concernObject (readonly)

Returns the value of attribute classify_concern.



10
11
12
# File 'app/controllers/curation_concerns/classify_concerns_controller.rb', line 10

def classify_concern
  @classify_concern
end

Instance Method Details

#createObject



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

#newObject



13
14
# File 'app/controllers/curation_concerns/classify_concerns_controller.rb', line 13

def new
end