【发布时间】:2018-12-12 11:14:59
【问题描述】:
我有一个搜索交易并返回结果的网址。这是一个邮政电话。网址是“http://192.168.58.129:3000/search”。我有一个名为 token 的列,其中包含值,并且我已经为每个值实现了 link_to。单击令牌值时,应根据令牌进行搜索。目前,它的行为类似于 get 调用,将所有参数附加到 url。我希望它的行为类似于具有相同 url(http://192.168.58.129:3000/search) 的帖子,参数附加到表单数据而不是 url。
`
<table class="table table-condensed table-hover" id="search-result-table" style="margin-left:2%">
<thead>
<tr>
<th>Transaction Id</th>
<th>Order Id</th>
<th>Store Id</th>
<th>Transaction Date</th>
<th>Transaction Type</th>
<th>Tender Type</th>
<th>Token</th>
<th>Amount</th>
<th>Currency</th>
<th>Response </br>Code</th>
</tr>
</thead>
<tbody>
<% @transactions.each do |transaction| %>
<tr>
<td><%= link_to transaction['payment_transaction_id'], details_path(payment_transaction_id: transaction['payment_transaction_id']), {:remote => true, 'data-toggle' => "modal", 'data-target' => '#modal-window'} %></td>
<td><%= transaction['payment_session_id'] %></td>
<td><%= transaction['store_id'] %></td>
<td><%= transaction['create_timestamp'].in_time_zone(@timezone).strftime('%B %d, %Y - %l:%M %p') %></td>
<td><%= @transaction_types[transaction['transaction_type']] %></td>
<td><%= @tenders[transaction['tender_type']][1] %></td>
<% if (@tenders[transaction['tender_type']][0]).in?(['PLCC', 'GC', 'CC', 'CBCC']) %>
<td><%= link_to transaction['payment_acct_unique_id'], params.merge(account_id: transaction['payment_acct_unique_id'], show_results: "true",clickAccount:"Y"), id: "act_id" %></td>
<% else %>
<td><%= transaction['payment_acct_unique_id'] %></td>
<% end %>
<% if show_settlement_type? %>
<td><%= PaymentsHelper.settlement_amount_with_currency_symbol transaction['transaction_amount'], transaction['iso_currency_code'],transaction['settlement_type'] %></td>
<% else %>
<td><%= PaymentsHelper.amount_with_currency_symbol transaction['transaction_amount'], transaction['iso_currency_code'] %></td>
<% end %>
<td><%= transaction['iso_currency_code'] %></td>
<% if transaction['transaction_status'] == ('F') %>
<td>Payment Service Error</td>
<% else %>
<td><%= transaction['response_code'] %></td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
`
【问题讨论】:
-
在
link_to中使用method: post