]> git.openstreetmap.org Git - rails.git/blob - app/controllers/browse_controller.rb
Commit crschmdt's data browser patch.
[rails.git] / app / controllers / browse_controller.rb
1 class BrowseController < ApplicationController
2   before_filter :authorize_web  
3   layout 'site'
4   def way_view 
5     begin
6       way = Way.find(params[:id])
7      
8       @way = way
9       @name = @way.tags['name'].to_s 
10       if @name.length == 0:
11         @name = "#" + @way.id.to_s
12       end       
13       @title = 'Way | ' + (@name)
14       
15     rescue ActiveRecord::RecordNotFound
16       render :nothing => true, :status => :not_found
17     end
18   end
19   def node_view 
20     begin
21       node = Node.find(params[:id])
22      
23       @node = node
24       @name = @node.tags_as_hash['name'].to_s 
25       if @name.length == 0:
26         @name = "#" + @node.id.to_s
27       end       
28       @title = 'Node | ' + (@name)
29       
30     rescue ActiveRecord::RecordNotFound
31       render :nothing => true, :status => :not_found
32     end
33   end
34 end