Am trying to do a bulk entry facility for some project or other. It
works but it feels ugly. I generate a form with twenty empty input
fields:
%= form_tag(“action” => “enter_stuff”) %>
<% (1…20).each do |line| %>
<%= line %>
<<%= text_field(“action”, “name”, “size” => 80) %>
 
<% end %>
<%= submit_tag(“Enter stuff”) %>
<%= end_form_tag %>
That creates twenty lines of html that looks like this:
The action enter_stuff looks like this
breakpoint('in main.enter_stuff')
request.params['action[name]'].each do |name|
if name != ""
action = Action.new
action.name = name
action.save
end
end
Can’t use @params. In the console @params looks like
{"commit=>“Enter stuff”, “action”=>“enter_stuff”, “controller”=>“main”)
Is there a cleaner way to do this?
Ed