X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/60becd1050dd2fc8c41b1cbfa8c5e3cd7d47a670..654d22ed2e30f406d036cb57273678c4406f3535:/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