1

I want to make an address search form (with geocoder) that returns all the possibles directions.

Something like this:

View:

  <%= form_tag user_lugar_path, :method => :get do %>   <p>
        <%= text_field_tag :search, params[:search] %>
        <%= submit_tag "Search directions", :name => nil %>   </p> <% end %>

Controller:

   def index
        if params[:search].present?
          @places = Geocoder.search((params[:search]))[10]
        else
          #
          #
        end   
    end

Its possible?? Thanks!

4

0 回答 0