Get colum types in auto form

Hi all,

I’m trying to build a routine that generates table rows with the
appropriate
field types (text_area and text_field for now), and filters out the
‘created_at’ and ‘deleted_at’.

<% for column in Project.content_columns %>
<tr class=“ListLine<%= cycle(“0”,“1”) %>”>

<%= column.human_name %>:
## The line below
<% if column.string %>
<%= text_field ‘project’, column.name %>
<% elsif column.text %>
<%= text_area ‘project’, column.name %>
<% end %>

Is there a cleaner way then doing and elsif sequence, and what is the
attribute name (‘type’ in this case) of a column. Been messing with
column.string but that doesn’t work.

Thanx n Greetz

Gerard.


“Who cares if it doesn’t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”

My $Grtz =~ Gerard;
~
:wq!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs