Class: SerialChronologiesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SerialChronologiesController
- Defined in:
- app/controllers/serial_chronologies_controller.rb
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
-
#create ⇒ Object
POST /serial_chronologies POST /serial_chronologies.json.
-
#destroy ⇒ Object
DELETE /serial_chronologies/1 DELETE /serial_chronologies/1.json.
-
#serial_chronology_params ⇒ Object
private
Never trust parameters from the scary internet, only allow the white list through.
-
#set_serial_chronology ⇒ Object
private
Use callbacks to share common setup or constraints between actions.
-
#update ⇒ Object
PATCH/PUT /serial_chronologies/1 PATCH/PUT /serial_chronologies/1.json.
Methods included from DataControllerConfiguration::SharedDataControllerConfiguration
Methods included from RedirectHelper
Methods included from RequestType
Methods included from LogRecent
Methods included from Cookies
#digest_cookie, #digested_cookie_exists?
Methods included from Whitelist
Methods included from ProjectsHelper
#cumulative_gb_per_year, #document_cumulative_gb_per_year, #document_gb_per_year, #gb_per_year, #image_cumulative_gb_per_year, #image_gb_per_year, #invalid_object, #project_classification, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form, #taxonworks_classification, #week_in_review_graphs
Methods included from Api::Intercept
Methods included from TokenAuthentication
#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate
Instance Method Details
#create ⇒ Object
POST /serial_chronologies POST /serial_chronologies.json
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/serial_chronologies_controller.rb', line 8 def create @serial_chronology = SerialChronology.new(serial_chronology_params) respond_to do |format| if @serial_chronology.save format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Serial chronology was successfully created.')} format.json {render json: @serial_chronology, status: :created, location: @serial_chronology} else format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Serial chronology was NOT successfully created.')} format.json {render json: @serial_chronology.errors, status: :unprocessable_entity} end end end |
#destroy ⇒ Object
DELETE /serial_chronologies/1 DELETE /serial_chronologies/1.json
38 39 40 41 42 43 44 |
# File 'app/controllers/serial_chronologies_controller.rb', line 38 def destroy @serial_chronology.destroy respond_to do |format| format.html { destroy_redirect @serial_chronology, notice: 'Serial chronology was successfully destroyed.' } format.json { head :no_content } end end |
#serial_chronology_params ⇒ Object (private)
Never trust parameters from the scary internet, only allow the white list through.
54 55 56 |
# File 'app/controllers/serial_chronologies_controller.rb', line 54 def serial_chronology_params params.require(:serial_chronology).permit(:preceding_serial_id, :succeeding_serial_id, :type) end |
#set_serial_chronology ⇒ Object (private)
Use callbacks to share common setup or constraints between actions.
48 49 50 51 |
# File 'app/controllers/serial_chronologies_controller.rb', line 48 def set_serial_chronology @serial_chronology = SerialChronology.find(params[:id]) @recent_object = @serial_chronology end |
#update ⇒ Object
PATCH/PUT /serial_chronologies/1 PATCH/PUT /serial_chronologies/1.json
24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/serial_chronologies_controller.rb', line 24 def update respond_to do |format| if @serial_chronology.update(serial_chronology_params) format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Serial chronology was successfully updated.')} format.json {head :no_content} else format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Serial chronology was NOT successfully updated.')} format.json {render json: @serial_chronology.errors, status: :unprocessable_entity} end end end |