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)



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

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
16
# File 'app/controllers/tasks/sources/new_source_controller.rb', line 8

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

#indexObject



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

def index
end