Topic: Generators - having columns in list view hardcode generated
I'm having problem with getting columns hard generated. I'm using haml_scaffold and the output for :model Flower is:
- for column in Flower.content_columns
It's basicly ok but I'd like to have output like (table flowers consist columns :name, :price):
The only problem is that generator has code like:
- for column in <%= model_name %>.content_columns
and it of course wouldn't work that way, cause it wants to get properties from "strings":
<% for column in model_name.content_columns %>
%th <%= column.human_name %>
<% end %>
Can anyone transform above code to the working one? So I can get that output I need.
I just don't know how to call an instance of an model object to get it's parameters.
Any help would be appreciated!