Rails: dynamic constant assignment

I’ve got an errorĀ  yesterday night that made me loose some time…

<% @myObjects.each{|T| -%>
    <div><%= T.name %></div>
<% end -%>

This returns a compile error “dynamic constant assignment”
I disovered that Rails does expect lowercase names attributes so my T was incorrect

Same code lowercase does works…

<% @myObjects.each{|t| -%>
	<div><%= t.name %></div>
 <% end -%>
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • RSS
  • StumbleUpon
  • Twitter
  • Reddit

Post a comment