Displaying 8 results from an estimated 8 matches for "item_count".
2005 Dec 13
0
Splitting records into multiple columns (can this code be improved?)
I have an array of categories, and I wanted them split
up into two columns in tables:
category item_count | category item_count
category item_count | category item_count
category item_count | category item_count
category item_count | category item_count
...
Here''s the template code:
<table>
<tr valign="top">
<td width="50%">
<table width=&...
2005 Dec 16
13
How to pass a collection to paginate?
There must be a better way to write this code:
@project_pages, @projects= paginate :project,
:per_page => 10,
:conditions => ["account_id = ?", account]
?!
If only I could pass the sub-collection
account = ...
@projects = account.project
to paginate, instead of letting it extract it with a find :all + sql
conditions
Alain.
--
Posted via
2007 Jun 20
1
Count_by_content ??
...e I''m wanting to do the following in my pagination method:
def list
# step 1: set the variables you''ll need
page = (params[:page] ||= 1).to_i
items_per_page = 20
offset = (page - 1) * items_per_page
# step 2: instead of performing a find, just get a count
item_count = Item.count_with_some_custom_method()
# step 3: create a Paginator, the second argument has to be the
number of ALL items on all pages
@item_pages = Paginator.new(self, item_count, items_per_page, page)
# step 4: only find the requested subset of @items
@items = Item.find_with_so...
2006 Jan 10
1
Can somebody explain when to reload an ActiveRecord
Hi all,
I''ve the following test method in my controller_test which increment the
''qty'' attribute in a has_many association, ''sa_report_products''. The
''item_count'' method returns the sum of all qty''s in ''sa_report_products'':
def test_add_product_to_report
sa_rpt = SaReport.find(1)
assert_equal 3, c = sa_rpt.item_count, ''initial count is 3''
assert_equal 2, sa_rpt.sa_report_products[0].qty, &...
2015 Oct 07
0
brass and chert compiled / xapian port to Interix
.../xapian-core-1.2.21/backends/chert/chert_check.cc
#include <climits>
+
+#include "str.h"
out << "base" << (char)B.base_letter
<< " blocksize=" << B.block_size / 1024 << "K"
- " items=" << B.item_count
+ << " items=" << str(B.item_count)
it's been suggested that (absent the above) gcc-3.4.2 might be a minimum version to compile the 1.2.x series brass & chert [on certain platforms, notably Interix], and gcc-4.2 for the 1.3.x series (owing to the dependency on C++...
2005 Dec 29
1
Paginate do a Count(*) request before...
...sg in the controller. (Everyone
has their own style but I like to keep my controller as streamlined
as I can.) Just use something like this in your view:
Listing
<%= @message_pages.current.first_item %> -
<%= @message_pages.current.last_item %> of
<%= pluralize(@ message_pages.item_count, ''message'') %>
HTH,
Kevin
2006 Apr 06
6
pagination question
i''ve figured out how to use the next and previous links with the
paginator class but now i''m trying to figure out how to display all the
page numbers in between. looking through the rails api, i found
paginator.each() but i''m not sure how to use it, or if that''s even what
i am looking for.
also, is there a way to limit the amount of pages like some sites
2018 Dec 06
3
Build error while upgrading samba 4.9.3
...ound
Checking for library menu : not found
Checking for set_menu_items : not found
Checking for macro set_menu_items : not found
Checking for item_count : not found
Checking for macro item_count : not found
Checking for library panel : not found
Checking for new_panel...