Sha256: 87b53a6d0a30e0f15c9400962d43107f06df78ad0fa474dce79d9693e1e9d702
Contents?: true
Size: 1.99 KB
Versions: 5
Compression:
Stored size: 1.99 KB
Contents
<div class="container"> <%= ph('Using will_paginate with post method') %> <p>In some cases, you may be want to use post method instead of get method when using will_paginate gem. You can try it with a search form which uses post method. See example:</p> <div class="bs-docs-example"> <form class="form-search" id="search-form" method="post"> <input type="text" class="input-medium search-query" name="search" value="<%= params[:search] %>"> <button type="submit" class="btn">Search</button> </form> <%= table(obj: @orders, pagi_method: 'post', pagi_form: 'search-form') do |t| %> <% t.column(h: {w: 3, l: 'Order Number'}) { |order| order.order_number } %> <% t.column(h: {w: 3, l: 'Customer Name'}) { |order| order.customer_name } %> <% t.column(h: {w: 2, l: 'Status'}) { |order| order.status } %> <% t.column(h: {w: 3, l: 'Action'}) do %> <%= link_to 'show', '#table' %> | <%= link_to 'edit', '#table' %> | <%= link_to 'destroy', '#table', data: {confirm: 'sure?'} %> <% end %> <% end %> </div> <pre class="prettyprint linenums lang-erb"> <form class="form-search" id="search-form" method="post"> <input type="text" class="input-medium search-query" name="search" value="<%= params[:search] %>"> <button type="submit" class="btn">Search</button> </form> <%= table(obj: @orders, pagi_method: 'post', pagi_form: 'search-form') do |t| %> <% t.column(h: {w: 3, l: 'Order Number'}) { |order| order.order_number }%> <% t.column(h: {w: 3, l: 'Customer Name'}) { |order| order.customer_name } %> <% column(h: {w: 2, l: 'Status'}) { |order| order.status } %> <% t.column(h: {w: 3, l: 'Action'}) do %> <%= link_to 'show', '#' %> | <%= link_to 'edit', '#' %> | <%= link_to 'destroy', '#', data: {confirm: 'sure?'} %> <% end %> <% end %> </pre> </div>
Version data entries
5 entries across 5 versions & 1 rubygems