Displaying 4 results from an estimated 4 matches for "first_item".
2007 Oct 30
2
How to switch off accepting the shortcut of column names
...I am working with the R version 2.4.1.
I realized it has a feature, which might be wonderful (as so many things in
R), but in this case might be a bit dangerous as well. It seems that columns
of a data frame can be called just by indicating the first letter of the
name of the column.
For example:
first_item <- seq(1,10)
second_item <- seq(11,20)
dat <- data.frame(first_item, second_item)
names(dat)
# [1] "first_item" "second_item"
dat$f
# [1] 1 2 3 4 5 6 7 8 9 10
dat$s
# [1] 11 12 13 14 15 16 17 18 19 20
The good thing is, that if there is more than one column...
2006 Jul 19
3
render :partial inserting new line in RJS
...all works fine, except that a new line is being inserted after the
partial and before the final single quote, which means the string isn''t
terminated. It''s definitely not in the partial, which is a simple
one-line: <li><%= #stuff %></li>
page << "first_item = $$(''#rant_list li'').first(); new Insertion.Before
first_item, ''#{render(:partial => ''rant_list_item'', :object => @rant)}'';"
Anybody got any ideas why it''s doing this?
2005 Dec 29
1
Paginate do a Count(*) request before...
...umber of items while in the view instead of having to set the
variables @total, @first_msg, @last_msg 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
2005 Dec 29
4
Paginate do a Count(*) request before, how access that count value.
Hello,
AV::paginate query first by a count, how access this value in the
controller or view ?
Why ?
Because I''ll like to display the total number or records found w/o
doing another expenssive Count.
Thanks,