Forum: Ruby on Rails Auto drop list: Create a form professional or easy?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
4710a8ada2adc162aaee4288d9879d8e?d=identicon&s=25 Gerard Petersen (Guest)
on 2006-01-28 14:13
(Received via mailing list)
Hi all,

I'm searching for a method to dynamically build a form. ( false/true
field in
the DB should automatically be a droplist)

If you use "_form.rhtml" it works easy, with only this code in your
but uses the extra file, and doesn't feel profi and flexible.

<%= start_form_tag :action => 'create_product' %>
  <%= render :partial => 'form' %>
  <%= submit_tag 'Edit' %>
<%= end_form_tag %>

If you do it like below, it looks really good and feels flexible, but
won't auto-create the droplists.

<%= start_form_tag :action=> "create_product" %>
	<table class="tablehack">

		<% for column in Product.content_columns %>
			<tr class="ListLine<%= cycle("0","1") %>">
			<td><%= column.human_name %>:</td>
			<td><%= text_field 'product',  %></td>
		<% end %>
	<input type="submit" value="Save" />
<%= end_form_tag %>

Any suggestions of you guru's are most welcome!!!!



"Who cares if it doesn't do anything?  It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process ..."

My $Grtz =~ Gerard;
This topic is locked and can not be replied to.