In der Regel hilft da mal in der Rails console ausprobieren oder den ganzen 
kram neu schreiben.

Gibt's irgend nen Grund für das 'for' anstelle eines 'each' außer dass es 
schlechter lesbar ist? 

Am 20.01.2011 um 11:14 schrieb Werner Laude:

> Hallo
> 
> class Seminardate < ActiveRecord::Base
> belongs_to :seminar
> 
> class Seminar < ActiveRecord::Base
>  has_many :seminardates, :dependent => :destroy
> 
> @seminardates = Seminardate.all.group_by{|p|p.start.beginning_of_month}
> 
> 
> <% @seminardates.keys.sort.each do |month|%>
> <%=l(month.to_date, :format => :only_month)%>
> 
>  <%for sem in @seminardates[month]%>
> 
> <%=sem.seminar.inspect%>
> Zeigt alle Werte aus der Tabelle Seminar
> 
> =>#<Seminar id: 1, location_id: 8, title: "Seminar sowieso",
> 
> 
> <%=sem.seminar.title%>
> 
> => undefined method `title' for nil:NilClass
> 
> Das will mir nicht einleuchten..kann mir jemand was dazu sagen?
> 
> Gruß+Danke
> 
> 
> 
> Werner Laude
> http://www.webagentur-laude.de
> 
> 
> 
> 
> 
> _______________________________________________
> rubyonrails-ug mailing list
> rubyonrails-ug@headflash.com
> http://mailman.headflash.com/listinfo/rubyonrails-ug

_______________________________________________
rubyonrails-ug mailing list
rubyonrails-ug@headflash.com
http://mailman.headflash.com/listinfo/rubyonrails-ug

Antwort per Email an