# Multiline input

**URL:** <https://www.ruby-forum.com/t/multiline-input/138014>\
**Category:** Rails\
**Created:** [May 19, 2008, 2:46pm UTC](https://www.ruby-forum.com/t/multiline-input/138014 "2008-05-19T14:46:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prasanna\_kumar\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f04885/32.png) [@Prasanna\_kumar\_N](https://www.ruby-forum.com/u/Prasanna_kumar_N)\
**Post date:** [May 19, 2008, 2:46pm UTC](https://www.ruby-forum.com/t/multiline-input/138014/1 "2008-05-19T14:46:57Z")

</div>

Hi

# Supposing i have a table Employees as follows

# id | Name | Age | Salary |

and use scaffold while generating model, view and controller by the  
command.

ruby script/generate scaffold Employee

When I go to the new entry page by choosing

[http://localhost:3000/Employees/new](http://localhost:3000/Employees/new)

I get a form with 3 fields after entering which and pressing submit  
buttons the entries are submitted to the database.

I i have to add one more entry i have to again press on new link and  
again enter them followed by pressing submit button. I will have to  
repeat the process 100 times if i have to enter hundred records.

Instead  
can I have multiple rows of input, so that i can enter all of them and  
press a single submit button, after which all the entries are submitted  
to the database?

Please let me know the approach i need to follow to achive this.

Thnaks  
Prasanna

---

<div class="post-metadata">

**Author:** ![Prasanna\_kumar\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f04885/32.png) [@Prasanna\_kumar\_N](https://www.ruby-forum.com/u/Prasanna_kumar_N)\
**Post date:** [May 19, 2008, 6:12pm UTC](https://www.ruby-forum.com/t/multiline-input/138014/2 "2008-05-19T18:12:45Z")

</div>

It’s possible to enter multiple rows of input. Check into using the  
array notation for your object (e.g., ‘users[]’).

However, I’d think through whether that makes sense in this particular  
case. You may have 100 users to add _initially_ and that might be a  
bit annoying, but is the “add a user” use case going to be used for  
multiple user entries very often? It sounds like an edge case.

On May 19, 8:46 am, Prasanna kumar Nagasamudram \<rails-mailing-

---

<div class="post-metadata">

**Author:** ![Prasanna\_kumar\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f04885/32.png) [@Prasanna\_kumar\_N](https://www.ruby-forum.com/u/Prasanna_kumar_N)\
**Post date:** [May 19, 2008, 6:27pm UTC](https://www.ruby-forum.com/t/multiline-input/138014/3 "2008-05-19T18:27:13Z")

</div>

AndyV wrote:

> It’s possible to enter multiple rows of input. Check into using the  
> array notation for your object (e.g., ‘users[]’).
> 
> However, I’d think through whether that makes sense in this particular  
> case. You may have 100 users to add _initially_ and that might be a  
> bit annoying, but is the “add a user” use case going to be used for  
> multiple user entries very often? It sounds like an edge case.
> 
> On May 19, 8:46 am, Prasanna kumar Nagasamudram \<rails-mailing-

Thanks for the response Andy.

Well im tying to devolop an application which simulates a time  
sheet(status report).

Where user may have to enter multiple rows of data.  
Say for example  
Project1 task1 10hrs  
Project1 task2 20hrs  
Project3 task1 5 hrs  
etc.  
and press submit button.
