Class: Tasks::Sources::NewSourceController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Tasks::Sources::NewSourceController
- Includes:
- TaskControllerConfiguration
- Defined in:
- app/controllers/tasks/sources/new_source_controller.rb
Instance Method Summary collapse
- #citation_param ⇒ Object protected
-
#crossref_preview ⇒ Object
GET /sources/new_source/crossref_preview.json.
- #index ⇒ Object
Methods included from TaskControllerConfiguration
Instance Method Details
#citation_param ⇒ Object (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_preview ⇒ Object
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 |
#index ⇒ Object
4 5 |
# File 'app/controllers/tasks/sources/new_source_controller.rb', line 4 def index end |