If I do a:
In controller: @x = User.find(:all)
In view: <% for rec in @x -%> <h1><%= rec[:username] %></h1> <% end -%>
It doesn't work. However, rec["username"] works. If I look with the breakpointer, of course all keys that ActiveRecord returns are strings. How can I access by symbol instead? (It is important so I can stay DRY ;-))
rec[:username.to_s]
would do it... just convert your symbol to a string...