1

I am trying to implement Ajax with a form_tag and a get method. I think i am doing it wrong and wanting to ask for suggestions to how to do this!

<%= form_tag("/event_feed", method: "get") do %>

Interests:  <%= text_field_tag(:keywords, params[:keywords], :placeholder => "Business, Food, Dance", :class => 'keyword')  %> 
Enter Zip or City: <%= text_field_tag(:code, user_location, :class => 'zip') %> 

Distance in miles: <%= select_tag(:distance_from_code, options_for_select(amount),  :class => 'dist') %>

<% #select_tag(:page_result, options_for_select(amount)) %>

<!--Dates hidden with css, selected by time slot-->
<%= select_date start.to_date, :prefix => :start_date %>
<%= select_date start.to_date + 1.day, :prefix => :end_date %>
<% #hidden_field_tag :start_date, start.to_date.strftime("%Y%m%d") %>
<% #hidden_field_tag :end_date, end_time.to_date.strftime("%Y%m%d") %>

<!--Pass on the selected time frame & amount of results required -->
<%= hidden_field_tag :start_time, start %>
<%= hidden_field_tag :end_time, end_time %>
<%= hidden_field_tag :page_result, 30 %>

<%= submit_tag "Submit", class: "search" %>

I don't want to pass the form to the url params/ I don't mind but how do i do that with Ajax?

4

0 に答える 0