小编Pal*_*Pal的帖子

在Rails中过滤形式?

我是Rails的新手.我简单地搭建了一个小模型.该模型有一个名为category的字段.现在我想按类别过滤索引页面上的条目.

<% form_for @domain do |f| %>
<p>
 Domain:
 <%= f.select(:Domain,%w{ LifeStyle Automobiles FoodAndBeverage Health IT Telecom EntertainmentAndCelebrity Education BankingInvestmentAndInsurance Travel Sports Parenting ConsumerElectronics RealtyAndLogistics CauseLed})%>


 <%= submit_tag "Filter" %>
</p>
<% end %>

<table border="1">
  <tr>
    <th>Domain</th>
    <th>Category</th>
    <th>Course detail</th>
    <th>Nameofblog</th>
    <th>Descriptionofblog</th>
    <th>Smename</th>
    <th>Smecommuntiy</th>
    <th>Smeifnotorkfac</th>
    <th>Noofmemb</th>
    <th>Discussionforumname</th>
    <th>Discussionforumdescription</th>
    <th>Qnasitesname</th>
    <th>Qnasitesnamedesc</th>
    <th>Newssitename</th>
    <th>Newssitedesc</th>
  </tr>

<% @media_universe_entries.each do |media_universe_entry| %>
  <tr>
    <td><%=h media_universe_entry.Domain %></td>
    <td><%=h media_universe_entry.Category %></td>
    <td><%=h media_universe_entry.CourseDetail %></td>
    <td><%=h media_universe_entry.NameOfBlog %></td>
    <td><%=h media_universe_entry.Descriptionofblog %></td>
    <td><%=h media_universe_entry.SMEname %></td>
    <td><%=h media_universe_entry.SMECommuntiy …
Run Code Online (Sandbox Code Playgroud)

ruby forms filtering ruby-on-rails

1
推荐指数
1
解决办法
4880
查看次数

在PHP文件中包含多个函数,并通过javascript文件中的jquery.post或jquery.get调用它们

我想从我的javascript文件中调用PHP中的各种函数.通常使用Jquery.post我们调用PHP文件并传递各种值作为post.

 function new_user(auth_type, tr_id, user_name, email)
    {
    $.post("bookmark.php",{AuthType:auth_type, TR_Id:tr_id, UserName:user_name, UserEmail:email});
    }
Run Code Online (Sandbox Code Playgroud)

如果我想在PHP文件中创建多个函数并通过jquery/ajax调用它们,我该怎么做?

javascript php ajax jquery

1
推荐指数
1
解决办法
4521
查看次数

标签 统计

ajax ×1

filtering ×1

forms ×1

javascript ×1

jquery ×1

php ×1

ruby ×1

ruby-on-rails ×1