带有form_tag getax方法的Ajax

时间:2013-07-07 21:43:31

标签: ruby-on-rails ruby ajax

我正在尝试使用form_tag和get方法实现Ajax。我想我做错了,想要询问如何做到这一点的建议!

<%= 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" %>

我不想将表单传递给url params /我不介意但是我如何使用Ajax做到这一点?

0 个答案:

没有答案