]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Add relation browsing:
[rails.git] / app / controllers / browse_controller.rb
index c35bb821a00e587b23da28457778faac762992b9..1806558f2d43146747f4ab068bcd7c7f42fcac12 100644 (file)
@@ -2,6 +2,21 @@ class BrowseController < ApplicationController
   before_filter :authorize_web  
   layout 'site'
 
+  def relation_view 
+    begin
+      @relation = Relation.find(params[:id])
+     
+      @name = @relation.tags['name'].to_s 
+      if @name.length == 0:
+       @name = "#" + @relation.id.to_s
+      end
+       
+      @title = 'Relation | ' + (@name)
+    rescue ActiveRecord::RecordNotFound
+      render :nothing => true, :status => :not_found
+    end
+  end
+  
   def way_view 
     begin
       @way = Way.find(params[:id])