How do I save a session variable (maybe into a cookie) when a user inputs a location? I'd like to keep this information for future sign ins. So they won't have to retype their location multiple times.
<%= form_tag search_path, :method => :get do %>
<%= text_field_tag :q, params[:q], :class => "search" %>
<%= text_field_tag :loc, params[:loc], :class => "search-main", :id => "loc-search", :placeholder => "address, neighborhood, city, state or zip" %>
<%= button_tag :type => :submit, :class => "btn btn-medium btn-inverse" do %>
<i class="icon-search icon-white"></i>
<% end %>
<% end %>
This is in my layouts/application.html.erb
I'd have to set a variable if it hasn't been set yet, and display it in the field if it is already set
locationto user's model and keep it there?