ruby - Rails / MongoDB: Variable to address object-attribute not translating -
in class aleshot have dynamic mongoid-attributes. in order index them, collect attributes in array called "dynamos". when want list these (see code below) get: undefined method 'dyn_f' #<aleshot:0x007f8f7ab18328>
ideas why dyn_f-variable isn't translated correctly?
<% @ale_shots.each |ale_shot| %> <tr> <td><%= ale_shot.name %></td> <% dynamos.each |dyn_f| %> <td><%= ale_shot.dyn_f %></td> <% end %> </tr> <% end %>
that because dyn_f
not defined field in model.
access this
ale_shot['dyn_f']
Comments
Post a Comment