Remove @midnode assign

It does not appear to be necessary and no other edit links
make use of it. SiteController#edit will calculate a precise
center coordinate.
This commit is contained in:
John Firebaugh 2012-09-29 11:09:01 -07:00 committed by Tom Hughes
parent 569f3cbe9b
commit 60becd1050
2 changed files with 1 additions and 6 deletions

View file

@ -30,9 +30,6 @@ class BrowseController < ApplicationController
@way = Way.find(params[:id], :include => [:way_tags, {:changeset => :user}, {:nodes => [:node_tags, {:ways => :way_tags}]}, :containing_relation_members])
@next = Way.visible.where("id > ?", @way.id).order("id ASC").first
@prev = Way.visible.where("id < ?", @way.id).order("id DESC").first
# Used for edit link, takes approx middle node of way
@midnode = @way.nodes[@way.nodes.length/2]
rescue ActiveRecord::RecordNotFound
render :action => "not_found", :status => :not_found
end

View file

@ -12,6 +12,4 @@
<hr />
<%= link_to(t('browse.way.download_xml'), :controller => "way", :action => "read") %>
| <%= link_to(t('browse.way.view_history'), :action => "way_history") %>
<% unless @midnode.nil? -%>
| <%= link_to(t('browse.way.edit'), :controller => "site", :action => "edit", :way => @way.id, :lat => @midnode.lat, :lon => @midnode.lon, :zoom => 16) %>
<% end -%>
| <%= link_to(t('browse.way.edit'), :controller => "site", :action => "edit", :way => @way.id) %>