> <% @appointments.group_by { |appointment|
> appointment.start.strftime("%Y-%d-%d") }.each_pair do |start_date,
> appointments| %>
>   <% appointments.each do |appointment| %>
>     <tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
>       <td><%= appointment.client.name %></td>
>       etc...
>   <% end %>
> <% end %>

Ok I got that, it returns apparently the same. But since it's now in a 
hash I will try to iterate through the hash. Will try to play with it on 
the console like you say.

> ...it would probably be "better" to pass the appointments array to a
> partial, and have that render the collection... but that's a separate
> issue - one step at a time :-)
Will try

> What don't you understand?
> The "@appointments.group_by.blah.blah" line? That's just a load of
> Ruby and Rails methods chained together... you could easily check out
> each one in the API and read about what they do... but one of the ways
> I like to find out what stuff like this is doing is play with it in
> the console. Break it apart and run it one method at a time; see what
> it returns, and make sure you understand why (with reference to the
> API docs, and your books)
Currently, I hate the Rails and Ruby API's.

I program on PHP. Whenever I needed to use some function I wasn't used 
to using, everything would be easily explained in the documentation. I 
looove the PHP documentation and the examples. You don't have to 
interpret anything because it is stated with simplicity.

Now, the Rails and the Ruby API's, it's like I'm trying to read Greek! I 
read the documentation, I think about it, I try to read it again, 
nothing, NOTHING is readable.  I kno, I kno, might take a while to get 
used to. Still a newbie :-S

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to