[Rails] Re: Having some trouble with loop in a form

2009-09-07 Thread Marnen Laibow-Koser
maximulus wrote: > Apology accepted, but ultimately didn't this become an issue of 'my > coding process is better than your coding process'? Perhaps it did. And why not? Some coding processes are better than others. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Post

[Rails] Re: Having some trouble with loop in a form

2009-09-07 Thread Dhruva Sagar
Your submit button is within the @items.each loop, hence I see that for each row there is an 'Add Item' button.There should be only 1 submit button in the end (if you want to submit the entire form) Thanks & Regards, Dhruva Sagar. Joan Crawford

[Rails] Re: Having some trouble with loop in a form

2009-09-07 Thread Abhinav Saxena
I guess you should not use f.submit for "Add item", instead you should use a link and a corresponding action which will add an item and render lineitem form again. Thanks, Abhinav -- अभिनव http://twitter.com/abhinav On Sun, Sep 6, 2009 at 10:36 AM, maximulus wrote: > > Hello, > > I'm clearly

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread Colin Law
2009/9/6 Hassan Schroeder : > > On Sun, Sep 6, 2009 at 10:48 AM, Colin Law wrote: > >>  ... There is no point validating it before it is >> functional (unless not sure why it is not functional of course in >> which case validating it is useful). > > Exactly my point. It is totally possible for inv

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread maximulus
Apology accepted, but ultimately didn't this become an issue of 'my coding process is better than your coding process'? Anyway, playing around with it, I got it to work, so in the hope that months from now, someone will come across the same issue, here is the working answer. It was simple, and fo

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread Hassan Schroeder
On Sun, Sep 6, 2009 at 10:48 AM, Colin Law wrote: > ... There is no point validating it before it is > functional (unless not sure why it is not functional of course in > which case validating it is useful). Exactly my point. It is totally possible for invalid markup, particularly involving for

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread Colin Law
2009/9/6 Hassan Schroeder : > > On Sun, Sep 6, 2009 at 10:18 AM, Colin Law wrote: > >>> Creating valid markup, as well as valid code, is how you *get to* a >>> "functional page" -- it's not an afterthought. >> >> Are you saying you do not check that it is valid afterwards? > > "After" what? After

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread Ari Lipsey
Again, thanks for the replies. I never said I don't do it. But my issue doesn't work with any browser at the moment, and even if I eliminate all the td elements (or the entire table), the same problem persists. The problem is in the ruby code, not the markup html yet, which is why I elect to do it

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread Hassan Schroeder
On Sun, Sep 6, 2009 at 10:18 AM, Colin Law wrote: >> Creating valid markup, as well as valid code, is how you *get to* a >> "functional page" -- it's not an afterthought. > > Are you saying you do not check that it is valid afterwards? "After" what? Validation, just like running unit tests, nee

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread Colin Law
2009/9/6 Hassan Schroeder : > > On Sun, Sep 6, 2009 at 7:50 AM, maximulus wrote: > >> Thanks Colin, once I get a functional page, I'll validate it. > > Creating valid markup, as well as valid code, is how you *get to* a > "functional page" -- it's not an afterthought. Are you saying you do not ch

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread Hassan Schroeder
On Sun, Sep 6, 2009 at 7:50 AM, maximulus wrote: > Thanks Colin, once I get a functional page, I'll validate it. Creating valid markup, as well as valid code, is how you *get to* a "functional page" -- it's not an afterthought. -- Hassan Schroeder hassan.schroe...@gmai

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread maximulus
Hello, Thanks for all the replies. I've used this format before in .Net using a datagrid, but I'm tring to apply it to RoR. Fred, if the issue is repeated parameter in a single form, am I best off attempting to add 'fields_for' to the form, or is there a way to make every row iterate on multiple

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread Colin Law
2009/9/6 maximulus : > > Hello, > > I'm clearly missing some bit of code, but I can't figure out what. > There are three models: Invoice, Lineitems and items. I want the user > to search a list of items, and then add them to the lineitems table. > The seach works, an provides a list on this form:

[Rails] Re: Having some trouble with loop in a form

2009-09-06 Thread Frederick Cheung
On Sep 6, 6:06 am, maximulus wrote: > Hello, > > I'm clearly missing some bit of code, but I can't figure out what. > There are three models: Invoice, Lineitems and items. I want the user > to search a list of items, and then add them to the lineitems table. > The seach works, an provides a lis