Class: Tasks::Sources::NewSourceController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/sources/new_source_controller.rb

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#citation_paramObject (protected)


19
20
21
22
23
24
25
# File 'app/controllers/tasks/sources/new_source_controller.rb', line 19

def citation_param
  begin
    params.require(:citation)
  rescue ActionController::ParameterMissing
    nil
  end
end

#crossref_previewObject

GET /sources/new_source/crossref_preview.json


8
9
10
11
12
13
14
15
# File 'app/controllers/tasks/sources/new_source_controller.rb', line 8

def crossref_preview
  if citation_param.blank?
    render json: :invalid_request
  else
    @source = TaxonWorks::Vendor::Serrano.new_from_citation(citation: citation_param)
    render '/sources/show'
  end
end

#indexObject


4
5
# File 'app/controllers/tasks/sources/new_source_controller.rb', line 4

def index
end