X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/406b46e49b786fab879286d77735b2a16c1cfcc5..50224b473bce736436d27c64bd46c1910e4d43ec:/app/controllers/browse_controller.rb?ds=sidebyside diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 9aec1060a..2962c6836 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -77,4 +77,13 @@ class BrowseController < ApplicationController rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found end + + def bug + @type = "bug" + @bug = MapBug.find(params[:id]) + @next = MapBug.find(:first, :order => "id ASC", :conditions => [ "status != 'hidden' AND id > :id", { :id => @bug.id }] ) + @prev = MapBug.find(:first, :order => "id DESC", :conditions => [ "status != 'hidden' AND id < :id", { :id => @bug.id }] ) + rescue ActiveRecord::RecordNotFound + render :action => "not_found", :status => :not_found + end end