Displaying 20 results from an estimated 20000 matches similar to: "using in_groups_of to get data to display horizontally"
2006 Sep 01
0
Are you using Array#in_groups_of(n, false)?
Are you using Array#in_groups_of(n, false)? That is, you want the
array chopped into n groups, and if its an uneven number, you want the
missing positions filled with "false". If so, please post the brief
snippet where it is being used.
(I''m trying to settle a bet with Mr. koz.)
--
David Heinemeier Hansson
http://www.loudthinking.com -- Broadcasting Brain
2008 Jan 01
7
in_vertical_groups_of
Hi all,
Here''s another contribution for anyone interested.
In Railscast episode 28, Ryan Bates showed us in_groups_of which
allows you to group array members such as
>> list = [1, 2, 3, 4, 5, 6, 7]
=> [1, 2, 3, 4, 5, 6, 7]
>> list.in_groups_of(3)
=> [[1, 2, 3], [4, 5, 6], [7, nil, nil]]
This allows you to iterate over the groups and, for example, display
a list
2006 Mar 06
2
form_tag error -- not found, 404 -- action DOES exist!
Hi -- I''ve got a very strange error.
I have an action called ''commit_input'' on a controller called
''SiteVisitController''. This definately exists, and is called from the
functional test for it, and passes fine.
My problem is with the form that is supposed to call this action.
The form tag is:
<%=
2006 Mar 17
1
How to update values in database in this form?
Hi,
This is my rHtml page & Corresponding actions & model pages:-
===listform.rHtml=================
<h1>Products List</h1>
<%= start_form_tag(:action => "add_to_cart")%>
<table>
<tr>
<%
i=0
%>
<th>
Product No.
</th>
<th>
Unit Price
</th>
<th>
Available Qty.
</th>
<th>
Demand Qty.
</th>
2009 Mar 08
1
Working with in_groups_of
I''m trying to build a table out using in groups of, but I''d also like to
be able to customize the first and last rows.
Apart from the actual formatting, is there an efficient way to figure
out how many total groups there are and what group the iteration is in?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this
2006 Jan 30
1
Introduction & time_zone_select with mapped TimeZone question
I''m new to this list, I''m a student in History, Computerscience and a
bit of Philosophy from the Netherlands... I have started using rails a
few weeks ago, I did read the Agile Webdevelopment with Rails book, and
I generally started to love Rails for it''s sheer beauty and intelligent
structure...
However I came across something that puzzles me quite a bit. It''s
2008 Sep 22
8
TimeZone daylight savings time problems
Here is the following from my console:
>> Time.now
=> Mon Sep 22 11:33:34 +0200 2008
>> Time.now.utc_offset
=> 7200
>> TimeZone[Time.now.utc_offset]
=> #<TimeZone:0x11aea90 @tzinfo=nil, @utc_offset=7200, @name="Athens">
>> Time.now.in_time_zone(TimeZone[Time.now.utc_offset])
=> Mon, 22 Sep 2008 12:34:22 EEST +03:00
(I am in Spain - CET - and
2006 Mar 09
1
Rails File Upload w/ Ajax Update?
I''m trying to upload a file, display the upload progress and then
update a table with the newly uploaded file. Is there a way to
specify a :success handler for form_tag_with_upload_progress such that
I have access to the request.response data (in the way I can with
link_to_remote)?
The :finish JavaScript is being executed but because there is no
request object, the table
2011 Oct 07
0
will_paginate + RJS error
Hi there!
I need some help, I''m new to rjs + will_paginate and don''t know how
to
solve this problem.
The application apparently is working fine, the partial is rendered
by the javascript, the pagination works fine, but sometimes, when I
hit the next page number or " next >>", it reders the code below.
Im using rails 2.3.8, ruby 1.8.7. and will_paginate 2.3.15
2006 Jul 26
0
radio_button groups
For my first rails app, I''m building a web page that will list some
restaurants and then have the user rate them from from 1 to 5 using 5
radio buttons. The view code looks like:
<h3>Ratings:</h3>
<form action="save_ratings" method="post">
<table>
<tr>
<th>Restaurant</th>
<% for rating_option in
2006 Apr 19
1
AJAX - update item forms problem
I have a table showing some records from the database. These records
should be always ordered by some datetime field. The list of items is
changed by AJAX using RJS scripts and edits are done by showing and
hiding an update form under a chosen row. Adding and updating rows works
great but my problem is when the order of items is changed after making
some AJAX datetime updates update forms of
2009 Jul 21
1
Problem with INTERNALDATE when the year in localtime and GMT different
In my thought utc_offset function in src/lib/utc-offset.c returns wrong
offset value when the year in localtime and GMT different.
/* max offset of 24 hours */
if (ltm.tm_yday < gtm.tm_yday)
offset = -24 * 60;
else if (ltm.tm_yday > gtm.tm_yday)
offset = 24 * 60;
else
offset = 0;
I think this code should be modified as followings.
/* max offset of 24 hours */
if ((ltm.tm_year ==
2006 Mar 23
1
Rails AJAX question, calling remote_function in a loop
I think I may be missing something here. I have a collection of people
I want to run through. For each person I want to use AJAX to make a
calculation and update the page with the results. First I tried to do
this with just links, which works fine. It looks like this
<% @eligible_players.each do |player| %>
<tr>
<td>
<%= link_to_remote( player.player_name,
2007 Sep 06
0
3 commits - libswfdec/swfdec_as_date.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite_movie.c
libswfdec/swfdec_as_date.c | 16 ++--
libswfdec/swfdec_as_interpret.c | 146 ++++++++++++++++++++++++++++++++++++++--
libswfdec/swfdec_movie.c | 43 +++++++----
libswfdec/swfdec_movie.h | 2
libswfdec/swfdec_sprite_movie.c | 37 ----------
5 files changed, 179 insertions(+), 65 deletions(-)
New commits:
diff-tree 89d295a9455fead858e48ffcae0cc5808d72ee22 (from
2006 Jan 13
0
Controller part of in-place editing
I''m doing some incremental improvements on scaffolding, and want to add
in-place editing to an admin section. I think I may have the view part
working right (at least, the editor pops up as expected) with this in my
view:
###
<% for link in @links %>
<tr>
<td> <div id="<%= ''url'' + link.id.to_s -%>"><%= link.url
2006 May 15
1
Trying to get values to display on horizontal barchart
Hello,
R 2.3.0
Windows XP
I have spent quite a bit of time trying to resolve my problem below, which included a R site search.
The "vertical bars" syntax below produces a vertical bar chart with the values displayed above each bar. I want to cast this graphic horizontally, but I have not been able to arrive at a suitable outcome. The best I have been able to do, using the second block
2011 Mar 28
0
Token Poken :( I'm stuck with this
Hay all!
I have question-answer base.. like quiz, yeah? yes!
So i need to do this way... my project without registration so this way
i need token..
user can answer on my question only once.. How can i do this? Iand i can
give him link, and link should be like : localhost:3000/token .. he gets
on this link, answer and click go and that''s all. If he want to get on
this page once again he
2009 Mar 31
2
TimeWithZone seems in rails 2.3 seems broken...is this the correct behavior?
My environment.rb contains
config.time_zone = ''UTC''
If my understanding is correct, rails should assume time values coming
from the database are UTC, and since config.time_zone is set to ''UTC'',
it should not try to convert the times.
Instead, rails is assuming that the db values are Eastern (my local
zone) and is incorrectly adding four hours to convert to
2010 Jun 14
2
How to disable day light saving on Snom 360 phones?
Greetings,
Sounds like a simple thing to do, but I was not able to do it on these
particular phones. Snom wiki was not helpful. My client wants to keep his
phones pointed to UTC time, no DST, no change in timezone, i.e. to stay at 0
hours difference.
The phones are provisioned from a tftp server.
If I remove 'dst' value from the provisioning file, on bootup phones force
users to pickup
2004 Apr 21
2
Resizing a ListCtrl
Hi Guys,
I''m having serious troubles resizing a dialog with a ListCtrl. The ctrl
will not resize horizontally no matter what I''m doing. I''ve attached a
sample code below. Any help will be greatly appreciated, as I really
like wxRuby :)
I''ve also tried to copy from the example from listtest.rbw, but that
also doesn''t seem to work.
Another thing