Ruby On Handling nil object

by JohnnyBusca, November 28, 2007 23:06

I had a some similar in htt...

0fe01b8879c35beee8c9b2e9212a5b87 Talk
def split_in_groups(values, cols=4) 
  cols.downto(1) do |col|
    group_size = (values.size / col.to_f).ceil - 1
...

Ruby On split_in_groups instead of ...

by JohnnyBusca, November 28, 2007 20:57

The example shown above ret...

0fe01b8879c35beee8c9b2e9212a5b87 Talk
<% col_size = (friends.size/4.0).ceil %>
<% friends.in_groups_of(col_size, false) do |group| %>
  <div class=‘list‘>
...

Ruby split_in_groups instead of ...

by JohnnyBusca, November 28, 2007 07:53, 5 refactorings, tagged with in_groups_of

I would like to have a piec...

0fe01b8879c35beee8c9b2e9212a5b87 Talk
puts "#{show_value_or_default(@me, "JohnnyBusca",&:name)} is very happy!"

Ruby On Show a default value if obj...

by JohnnyBusca, October 04, 2007 06:41

Thanks very much.. I wanted...

0fe01b8879c35beee8c9b2e9212a5b87 Talk
# this method returns a default when the object does not exist or the value given in the block does not exist.
#
# Example:
...

Ruby Show a default value if obj...

by JohnnyBusca, October 03, 2007 00:48, 5 refactorings

Often in the view you want ...

0fe01b8879c35beee8c9b2e9212a5b87 Talk