Class: OtuRelationshipsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- OtuRelationshipsController
- Defined in:
- app/controllers/otu_relationships_controller.rb
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
-
#create ⇒ Object
POST /otu_relationships or /otu_relationships.json.
-
#destroy ⇒ Object
DELETE /otu_relationships/1 or /otu_relationships/1.json.
-
#edit ⇒ Object
GET /otu_relationships/1/edit.
-
#index ⇒ Object
GET /otu_relationships or /otu_relationships.json.
- #list ⇒ Object
-
#new ⇒ Object
GET /otu_relationships/new.
- #otu_relationship_params ⇒ Object private
- #set_otu_relationship ⇒ Object private
-
#show ⇒ Object
GET /otu_relationships/1 or /otu_relationships/1.json.
-
#update ⇒ Object
PATCH/PUT /otu_relationships/1 or /otu_relationships/1.json.
Methods included from DataControllerConfiguration::ProjectDataControllerConfiguration
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 /otu_relationships or /otu_relationships.json
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/otu_relationships_controller.rb', line 45 def create @otu_relationship = OtuRelationship.new(otu_relationship_params) respond_to do |format| if @otu_relationship.save format.html { redirect_to otu_relationship_url(@otu_relationship), notice: 'Otu relationship was successfully created.' } format.json { render :show, status: :created, location: @otu_relationship. } else format.html { render :new, status: :unprocessable_entity } format.json { render json: @otu_relationship.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /otu_relationships/1 or /otu_relationships/1.json
73 74 75 76 77 78 79 80 |
# File 'app/controllers/otu_relationships_controller.rb', line 73 def destroy @otu_relationship.destroy respond_to do |format| format.html { redirect_to otu_relationships_url, notice: 'Otu relationship was successfully destroyed.' } format.json { head :no_content } end end |
#edit ⇒ Object
GET /otu_relationships/1/edit
41 42 |
# File 'app/controllers/otu_relationships_controller.rb', line 41 def edit end |
#index ⇒ Object
GET /otu_relationships or /otu_relationships.json
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/otu_relationships_controller.rb', line 9 def index respond_to do |format| format.html do @recent_objects = OtuRelationship.where(project_id: sessions_current_project_id) .order(updated_at: :desc) .limit(10) render '/shared/data/all/index' end format.json { @otu_relationships = OtuRelationship.where(project_id: sessions_current_project_id) .page(params[:page]) .per(params[:per]) } end end |
#list ⇒ Object
29 30 31 32 33 |
# File 'app/controllers/otu_relationships_controller.rb', line 29 def list @otu_relationships = OtuRelationship.where(project_id: sessions_current_project_id) .page(params[:page]) .per(params[:per]) end |
#new ⇒ Object
GET /otu_relationships/new
36 37 38 |
# File 'app/controllers/otu_relationships_controller.rb', line 36 def new @otu_relationship = OtuRelationship.new end |
#otu_relationship_params ⇒ Object (private)
87 88 89 90 91 92 93 |
# File 'app/controllers/otu_relationships_controller.rb', line 87 def otu_relationship_params params.require(:otu_relationship).permit( :subject_otu_id, :type, :object_otu_id ) end |
#set_otu_relationship ⇒ Object (private)
83 84 85 |
# File 'app/controllers/otu_relationships_controller.rb', line 83 def set_otu_relationship @otu_relationship = OtuRelationship.where(project_id: sessions_current_project_id).find(params[:id]) end |
#show ⇒ Object
GET /otu_relationships/1 or /otu_relationships/1.json
26 27 |
# File 'app/controllers/otu_relationships_controller.rb', line 26 def show end |
#update ⇒ Object
PATCH/PUT /otu_relationships/1 or /otu_relationships/1.json
60 61 62 63 64 65 66 67 68 69 70 |
# File 'app/controllers/otu_relationships_controller.rb', line 60 def update respond_to do |format| if @otu_relationship.update(otu_relationship_params) format.html { redirect_to otu_relationship_url(@otu_relationship), notice: 'Otu relationship was successfully updated.' } format.json { render :show, status: :ok, location: @otu_relationship. } else format.html { render :edit, status: :unprocessable_entity } format.json { render json: @otu_relationship.errors, status: :unprocessable_entity } end end end |