X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/60becd1050dd2fc8c41b1cbfa8c5e3cd7d47a670..40b3c828e7289cc3e3566375450ee378c8229bc4:/app/controllers/browse_controller.rb?ds=inline diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index e5557280e..5526aacca 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -76,4 +76,13 @@ class BrowseController < ApplicationController rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found end + + def note + @type = "note" + @note = Note.find(params[:id]) + @next = Note.find(:first, :order => "id ASC", :conditions => [ "status != 'hidden' AND id > :id", { :id => @note.id }] ) + @prev = Note.find(:first, :order => "id DESC", :conditions => [ "status != 'hidden' AND id < :id", { :id => @note.id }] ) + rescue ActiveRecord::RecordNotFound + render :action => "not_found", :status => :not_found + end end