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