Topic: new to rails --need-help

i have a model called A and another is B. i developed an html form for A. the model B has only one attribute say "task". my query is, there is one button say "add task". that is, if i press it, it should generate another text field for adding a task and if i again press it, it should generate another text field for task and so on, in sort i want to generate new model on a button press. so i think it will need javascript to be done but i don't know how to do this.

please reply if you know how to do it, your reply will be fully appriciated.