search done
This commit is contained in:
parent
49a1b4ef29
commit
6b4803d87f
4 changed files with 35 additions and 5 deletions
|
@ -1,7 +1,10 @@
|
|||
class SiteController < ApplicationController
|
||||
before_filter :authorize_web
|
||||
before_filter :require_user, :only => [:edit]
|
||||
def index
|
||||
|
||||
|
||||
def search
|
||||
@tags = WayTag.find(:all, :conditions => ["match(v) against (?)", params[:query][:query].to_s] )
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
|
||||
|
||||
<div id="geocoder">
|
||||
<form action="/search.html">
|
||||
<input type="text" name="query" value="" size="60">
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
<%= start_form_tag :controller => 'site', :action => 'search' %>
|
||||
<%= text_field 'query', 'query'%>
|
||||
<%= submit_tag 'Search' %>
|
||||
<%= end_form_tag %>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
24
app/views/site/search.rhtml
Normal file
24
app/views/site/search.rhtml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<h2>Search results</h5>
|
||||
fixme postcodes and geonames
|
||||
|
||||
<%= start_form_tag :controller => 'site', :action => 'search' %>
|
||||
<%= text_field 'query', 'query'%>
|
||||
<%= submit_tag 'Search' %>
|
||||
<%= end_form_tag %>
|
||||
|
||||
|
||||
<table border="0">
|
||||
<% @tags.each do |tag| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to tag.v, :controller => 'site', :action => 'goto_way', :id => tag.id %> (k:<%= tag.k %>)<br>
|
||||
<font size="-2" color="green">
|
||||
Way <%= tag.id %> (<%= tag.way.timestamp %>)
|
||||
<%= link_to 'Map', :controller => 'site', :action => 'goto_way', :id => tag.id %> -
|
||||
<%= link_to 'API', :controller => 'way', :action => 'rest', :id => tag.id %>
|
||||
<br /><br/ >
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
Loading…
Add table
Add a link
Reference in a new issue