]> git.openstreetmap.org Git - rails.git/blob - app/controllers/site_controller.rb
3c7d3ff82a4c97d1283bf5ed353618eaf5424c8a
[rails.git] / app / controllers / site_controller.rb
1 class SiteController < ApplicationController
2   before_filter :authorize_web
3   before_filter :require_user, :only => [:edit]
4
5
6   def search
7     @tags = WayTag.find(:all, :limit => 11, :conditions => ["match(v) against (?)", params[:query][:query].to_s] )
8   end
9
10   def goto_way
11     way = Way.find(params[:id])
12
13     begin
14       node = way.way_segments.first.segment.from_node
15       redirect_to :controller => 'site', :action => 'index', :lat => node.latitude, :lon => node.longitude, :zoom => 6
16     rescue
17       redirect_to :back
18     end
19   end
20
21 end