X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/14bc538681ca1e6b54dc2da67718e67ea6e1ec04..00375024263970a43ea7d39e3c65dfd0f32e8869:/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