Class: GeographicAreasGeographicItemsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- GeographicAreasGeographicItemsController
- Defined in:
- app/controllers/geographic_areas_geographic_items_controller.rb
Overview
This class helps edit the relationships between GeographicAreas and GeographicItems
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
-
#create ⇒ Object
POST /geographic_areas_geographic_items POST /geographic_areas_geographic_items.json.
-
#destroy ⇒ Object
DELETE /geographic_areas_geographic_items/1 DELETE /geographic_areas_geographic_items/1.json.
-
#edit ⇒ Object
GET /geographic_areas_geographic_items/1/edit.
-
#geographic_areas_geographic_item_params ⇒ Object
private
Never trust parameters from the scary internet, only allow the white list through.
-
#new ⇒ Object
GET /geographic_areas_geographic_items/new.
-
#set_geographic_areas_geographic_item ⇒ Object
private
Use callbacks to share common setup or constraints between actions.
-
#update ⇒ Object
PATCH/PUT /geographic_areas_geographic_items/1 PATCH/PUT /geographic_areas_geographic_items/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 /geographic_areas_geographic_items POST /geographic_areas_geographic_items.json
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/geographic_areas_geographic_items_controller.rb', line 18 def create @geographic_areas_geographic_item = GeographicAreasGeographicItem.new(geographic_areas_geographic_item_params) respond_to do |format| if @geographic_areas_geographic_item.save format.html { redirect_to @geographic_areas_geographic_item, notice: 'Geographic areas geographic item was successfully created.' } format.json { render action: 'show', status: :created, location: @geographic_areas_geographic_item } else format.html { render action: 'new' } format.json { render json: @geographic_areas_geographic_item.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /geographic_areas_geographic_items/1 DELETE /geographic_areas_geographic_items/1.json
48 49 50 51 52 53 54 |
# File 'app/controllers/geographic_areas_geographic_items_controller.rb', line 48 def destroy @geographic_areas_geographic_item.destroy respond_to do |format| format.html { redirect_to geographic_areas_geographic_items_url } format.json { head :no_content } end end |
#edit ⇒ Object
GET /geographic_areas_geographic_items/1/edit
13 14 |
# File 'app/controllers/geographic_areas_geographic_items_controller.rb', line 13 def edit end |
#geographic_areas_geographic_item_params ⇒ Object (private)
Never trust parameters from the scary internet, only allow the white list through.
68 69 70 |
# File 'app/controllers/geographic_areas_geographic_items_controller.rb', line 68 def geographic_areas_geographic_item_params params.require(:geographic_areas_geographic_item).permit(:geographic_area_id, :geographic_item_id, :data_origin, :origin_gid, :date_valid_from, :date_valid_to) end |
#new ⇒ Object
GET /geographic_areas_geographic_items/new
8 9 10 |
# File 'app/controllers/geographic_areas_geographic_items_controller.rb', line 8 def new @geographic_areas_geographic_item = GeographicAreasGeographicItem.new end |
#set_geographic_areas_geographic_item ⇒ Object (private)
Use callbacks to share common setup or constraints between actions.
63 64 65 |
# File 'app/controllers/geographic_areas_geographic_items_controller.rb', line 63 def set_geographic_areas_geographic_item @geographic_areas_geographic_item = GeographicAreasGeographicItem.find(params[:id]) end |
#update ⇒ Object
PATCH/PUT /geographic_areas_geographic_items/1 PATCH/PUT /geographic_areas_geographic_items/1.json
34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/geographic_areas_geographic_items_controller.rb', line 34 def update respond_to do |format| if @geographic_areas_geographic_item.update(geographic_areas_geographic_item_params) format.html { redirect_to @geographic_areas_geographic_item, notice: 'Geographic areas geographic item was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @geographic_areas_geographic_item.errors, status: :unprocessable_entity } end end end |