I've got the datebox engine working fine if I just have one datebox on a form. It is a very nice little gui. How do I configure it to handle multiple date boxes corresponding to multiple table fields? Thanks Greg -- Greg F. The Norcross Group Forensics for the 21st Century
on 2006-02-17 02:54
on 2006-02-17 04:00
That feature hasn't been added yet. I have a few emails outlining how someone did it, but haven't integrated it into a new version yet. Feel free to submit patches, or example code how you manage to do it if you get around to it. -Nb ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Nathaniel S. H. Brown http://nshb.net ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
on 2006-02-17 21:04
Just realized I got ahead of myself. I have reduced the databox's down to one on each of two forms. They both appear to work from a gui perspective, but when I do a save nothing changes in the DB. Thus if I'm creating a new record the date field ends up blank. If I'm editing an exiting record, the date field remains unchanged. Any idea what I'm doing wrong? On 2/16/06, Nathaniel S. H. Brown <firstname.lastname@example.org> wrote: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Subject: [Engine-users] datebox_engine with multiple > > Thanks > > > > _______________________________________________ > engine-users mailing list > email@example.com > http://lists.rails-engines.org/listinfo.cgi/engine... > -- Greg F. The Norcross Group Forensics for the 21st Century
on 2006-02-18 02:44
On 2/16/06, Nathaniel S. H. Brown <firstname.lastname@example.org> wrote: > That feature hasn't been added yet. > > I have a few emails outlining how someone did it, but haven't integrated it > into a new version yet. > > Feel free to submit patches, or example code how you manage to do it if you > get around to it. > > -Nb I've got this working I think. I did NOT have to modify the engine. I'm still fairly new with ruby/rails so I'm sure there are more elegant ways to handle this. In my partial view (_form.rhtml) I have: <td><%= @email@example.com_field1 date_box('date_field1') %> <td><%= @firstname.lastname@example.org_field2 date_box('date_field2') %> <td><%= @email@example.com_field3 date_box('date_field3') %> As you can see I'm creating 3 distinct instance variables initialized from my table. Then I'm passing the name of the instance variables into date_box. FYI: I tried directly passing in table.date_field1, but it croaked for some reason I don't understand. Question: Is there a end of line character like ; in C to allow the above to be on one line each? With the above the existing unmodified engine causes the 3 new instance variables to be available as params so in my controller I updated my update and create methods to have: @table.date_field1 = params[:date_field1] @table.date_field2 = params[:date_field2] @table.date_field3 = params[:date_field3] The above is immediately after the table.find(params[:id]) line in both the update and create methods. I never did get the automatic database field updating feature to work with even a single date. For someone that has that feature working maybe they could eliminate having to add the extra lines to the update method. HTH Greg -- Greg F.
on 2006-02-24 02:59
You can always just use a ; to separate Ruby statements... > > Question: Is there a end of line character like ; in C to allow the > above to be on one line each?