X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/56500280d4dfa645ef7cc8699a7802912893b6fc..868ce8d467210564211f6ed68f5f40fdd444ded5:/app/controllers/trace_controller.rb?ds=sidebyside diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 3b3097755..3eb7f5c7e 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -120,6 +120,24 @@ class TraceController < ApplicationController render :nothing => true, :status => :not_found end + def edit + @trace = Trace.find(params[:id]) + + if @user and @trace.user == @user + if params[:trace] + @trace.description = params[:trace][:description] + @trace.tagstring = params[:trace][:tagstring] + if @trace.save + redirect_to :action => 'view' + end + end + else + render :nothing, :status => :forbidden + end + rescue ActiveRecord::RecordNotFound + render :nothing => true, :status => :not_found + end + def delete trace = Trace.find(params[:id])