Class: GeographicItemsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- GeographicItemsController
- Defined in:
- app/controllers/geographic_items_controller.rb
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
-
#edit ⇒ Object
GET /geographic_items/1/edit.
- #geographic_item_params ⇒ Object private
- #set_geographic_item ⇒ Object private
-
#show ⇒ Object
GET /geographic_items/1 GET /geographic_items/1.json GET /geographic_items/1.wkt.
-
#update ⇒ Object
PATCH/PUT /geographic_items/1 PATCH/PUT /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
#edit ⇒ Object
GET /geographic_items/1/edit
25 26 |
# File 'app/controllers/geographic_items_controller.rb', line 25 def edit end |
#geographic_item_params ⇒ Object (private)
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'app/controllers/geographic_items_controller.rb', line 59 def geographic_item_params params.require(:geographic_item).permit( :point, :line_string, :polygon, :multi_point, :multi_line_string, :multi_polygon, :geometry_collection, :shape ) end |
#set_geographic_item ⇒ Object (private)
54 55 56 57 |
# File 'app/controllers/geographic_items_controller.rb', line 54 def set_geographic_item @geographic_item = GeographicItem.find(params[:id]) @recent_object = @geographic_item end |
#show ⇒ Object
GET /geographic_items/1 GET /geographic_items/1.json GET /geographic_items/1.wkt
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/geographic_items_controller.rb', line 10 def show respond_to do |format| format.html {} format.json {} format.wkt { render plain: @geographic_item.to_wkt, layout: false } format.geojson { render json: @geographic_item.to_geo_json, layout: false } end end |
#update ⇒ Object
PATCH/PUT /geographic_items/1 PATCH/PUT /geographic_items/1.json
30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/geographic_items_controller.rb', line 30 def update respond_to do |format| if @geographic_item.update(geographic_item_params) format.html { redirect_to @geographic_item., notice: 'Geographic item was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @geographic_item.errors, status: :unprocessable_entity } end end end |