On 9 March 2016 at 21:06, John Sanderbeck <li...@ruby-forum.com> wrote: > Colin Law wrote in post #1182068: >> On 9 March 2016 at 16:43, John Sanderbeck <li...@ruby-forum.com> wrote: >> Firstly please quote the previous message when you reply, this is a >> mailing list not a forum (though you may be accessing it via a forum >> like interface) so if you do not quote the previous message we have to >> look back through previous messages to get the context. Thanks. > > Sorry... I assumed that since the site was called ruby-forums that this > was a forum... :-)
That is the site you are looking at but that is not the list, it is a separate site that provides a forum like interface into the list. It is entirely independent of the list. If you like a forum style interface then by all means use that. Many much prefer the mailing list format however. > >> I don't know about you but I find that watching tutorials is nowhere >> near as good as working right through it oneself, doing the exercises, >> finding out how to interpret errors when one makes copying errors and >> so on, so I still suggest taking a few days out to work right through >> railstutorial.org. > > I will do that... > >> However, looking at your problem, I am not sure exactly what it is >> that you cannot do. You said: >>> So the form should show All Organization names with the count from the >>> Attendee Table >> >> What exactly is it that you do not know how to do? Is it accessing >> the organisation names, determining the count of attendees, iterating >> the names, displaying that information on the page or what? Also I >> don't understand what simple form has got to do with just displaying >> the data you describe. Forms are for inputting data, not just >> displaying it. > > I want to list every organization in a list (whether or not they have a > count) with a text entry box that is the attendance_count for that > organization. When I write I will just ignore the organizations that > have a count of zero. The attendance_count is in the Attendees table so > I can have a many_to_many relationship. I find all kinds of references > for radio buttons and check boxes with check_box_tag and > collection_check_box, but nothing for a number field. I assumed this was > a SImple Form syntax issue and not just a Ruby/Rails syntax issue. > > As in > > Training Name: [ ] > Training Date: [ ] > > Attendance: > ------------------------- > Organization #1: [ 0 ] > Organization #2: [ 20 ] > etc... OK, I did not realise that you wanted to input a numeric value. The fact that it is an integer rather than, for example, a text string, is irrelevant to the form. You just need to use f.input. What you do with that in the controller, of course, is up to you. You must presumably validate the field accordingly. I am not sure I would recommend that a beginner uses simple form. It is a two edged sword. It does make some things very easy but because you have not learned the basics of using a form whenever you need to do something different you may not have the basic knowledge to handle it. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsr9UwObNqx5VYE-TWa2SLqqniOVmtZOCd_QoxsqDxkhA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.