Hi Nathan, I don''t see the code, so this is only my guess. Check if it is task.project.id instead task.project_id. Somehow the project_id is treated as a method that doesn''t exist. Sam rails-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org 写道: Send Rails mailing list submissions to rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.rubyonrails.org/mailman/listinfo/rails or, via email, send a message with subject or body ''help'' to rails-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org You can reach the person managing the list at rails-owner-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rails digest..." Today''s Topics: 1. Re: Scriptaculous: directions? (Jay Levitt) 2. Re: RMagick problem in OS X (PJ Hyett) 3. ordered hashes Controller -> View (Thomas Balthazar) 4. Re: ordered hashes Controller -> View (Jorge Santiago) 5. Re: Re: Scriptaculous: directions? (Tomas Jogin) 6. validates_uniqueness_of for a group (Dewey Howell) 7. Control break in Rails (Carlos Pavia) 8. Re: Getting a value from datetime_select (Anon) 9. Parent-Child Table Relationship Problems (Nathan Mealey) ---------------------------------------------------------------------- Message: 1 Date: Sat, 3 Sep 2005 17:03:17 -0400 From: Jay Levitt Subject: [Rails] Re: Scriptaculous: directions? To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: Content-Type: text/plain; charset="iso-8859-15" In article <9B6586EE-B325-4394-B00E-1F4015FA8AB6-9D208sng4xU@public.gmane.org>, thomas- 9D208sng4xU-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says...> I put the effects library to very good use in a (AJAX) product we > develop. I wouldn''t have made it if I had no use for it. > > As an example, we put the Shake effect on the login box, when login > fails. We''ve sliding in/out property drawers. And so on and so forth. > All in all we use effects on 4 or 5 occasions throughout the app > where they just make the UI experience much more smooth and enjoyable > for the user.Interesting - put to those uses, I can certainly see how the effects could help focus attention on an important control (shake), or literally add depth to a UI (drawers). Any way you could put up a demo showing those functions in their "native environment"? I know I just don''t have the imagination to come up with that. Likewise, if 10 years ago you''d showed me a new library that would draw drop-shadows around a rectangular area, I''d have thought "Sure, that''s nice for 3D games", never thinking about its application in a window manager. I think an awful lot of developers who are not UI designers are going to mimic the uses they see in the demo. Maybe it''s as important to highlight good uses of these effects as it is to code them in the first place... I''d just hate for Rails to get the reputation as "that easy-to-use web framework with all the blinking, moving stuff". I''m checking out the ajaxpatterns site, and it looks pretty interesting, but of course their section on visual effects just points back at your existing demo. -- Jay Levitt | Wellesley, MA | I feel calm. I feel ready. I can only Faster: jay at jay dot fm | conclude that''s because I don''t have a http://www.jay.fm | full grasp of the situation. - Mark Adler ------------------------------ Message: 2 Date: Sat, 3 Sep 2005 17:08:28 -0500 From: PJ Hyett Subject: Re: [Rails] RMagick problem in OS X To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: Content-Type: text/plain; charset=ISO-8859-1 My only suggestion is to look at the OS X readme that comes with the RMagick tarball and follow it exactly step-by-step. It took me a few tries, but I eventually figured it out. -PJ http://pjhyett.com On 9/2/05, Pedro Valentini wrote:> Hi, > I''m installed ImageMagick and RMagick in an OS X and when I try to > require RMagick lib I get this error: > > irb(main):001:0> require ''RMagick'' > dyld: ruby version mismatch for library: > /usr/X11R6/lib/libfreetype.6.dylib (compatibility version of user: > 10.0.0 greater than library''s version: 6.3.0) > Trace/BPT trap > > Someone know what can be wrong? > Thank you > > -- > > Pedro C. Valentini > pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org > +55 (21) 8708-8035 > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >------------------------------ Message: 3 Date: Sun, 4 Sep 2005 01:02:09 +0200 From: Thomas Balthazar Subject: [Rails] ordered hashes Controller -> View To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hi everybody, In my Controller, I''m doing this : def list @hash_column_titles = { ''firstname'' => "Name", ''email'' => "E-mail", ''role_id'' => "Role", ''status'' => "Status" } end When I''m in my View, and that I iterate through this Hash, I get the values in the wrong order. @hash_column_titles.each { |column_name, column_label| ... } Am I doing something wrong? What can I do the have my Hash ordered in the same way it was declared? Thanks in advance for your help. Have a nice Sunday, all! Thomas Balthazar. ------------------------------ Message: 4 Date: Sat, 3 Sep 2005 18:14:13 -0500 From: Jorge Santiago Subject: Re: [Rails] ordered hashes Controller -> View To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Hi Thomas Hashes dont respect any order. You have to use an Array. santiago. On 9/3/05, Thomas Balthazar wrote:> Hi everybody, > > In my Controller, I''m doing this : > > def list > @hash_column_titles = { > ''firstname'' => "Name", > ''email'' => "E-mail", > ''role_id'' => "Role", > ''status'' => "Status" > } > end > > When I''m in my View, and that I iterate through this Hash, I get the > values in the wrong order. > > @hash_column_titles.each { |column_name, column_label| > ... > } > > Am I doing something wrong? > > What can I do the have my Hash ordered in the same way it was declared? > > Thanks in advance for your help. > Have a nice Sunday, all! > > Thomas Balthazar. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >------------------------------ Message: 5 Date: Sun, 4 Sep 2005 01:39:45 +0200 From: Tomas Jogin Subject: Re: [Rails] Re: Scriptaculous: directions? To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: <8c05e657050903163936f66d27-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> Content-Type: text/plain; charset=ISO-8859-1> Interesting - put to those uses, I can certainly see how the effects > could help focus attention on an important control (shake), or literally > add depth to a UI (drawers). > > Any way you could put up a demo showing those functions in their "native > environment"? I know I just don''t have the imagination to come up with > that.Both those examples are adaptations of UI elements in Mac OS X (which I too have shamelessly copied in my apps). So for a demo, check out Mac OS X (the adaptation to the web will be left for you to imagine). Without the use of Ajax, those effects might very well be pointless and over-the-top, but in an Ajaxified interface, lacking the normal browser reload user feedback, as David suggested earlier, those effects are absolutely necessary in order to provide a userfriendly interface. An ajax implementation _without_ those effects would be poor and half-assed. Regards, Tomas Jogin ------------------------------ Message: 6 Date: Sat, 3 Sep 2005 18:48:24 -0700 From: Dewey Howell Subject: [Rails] validates_uniqueness_of for a group To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: <107869500509031848a55da48-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> Content-Type: text/plain; charset=ISO-8859-1 Hi I have 2 questions: I want to validate that 3 fields together must be unique. e.g - first_name, last_name and birth_date. To ensure 2 fields are unique as a group I can do this: validates_uniqueness_of :first_name, :scope => "last_name" 1) How do I add the third term so that all three are checked together? Just to ensure my question is clear: ---John Smith DOB 4/4/1970 and John Smith DOB 4/4/1980 would be allowed but not if all three fields matched. 2) How do I set it to highlight all three fields but only output one message like "First name, last name & birth date must be unique" Thanks, Dewey ------------------------------ Message: 7 Date: Sat, 3 Sep 2005 22:57:32 -0300 From: Carlos Pavia Subject: [Rails] Control break in Rails To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: <7a4512630509031857404a5ff-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> Content-Type: text/plain; charset="iso-8859-1" What is the best way to implement a control break, in Rails ? Suppose we have a table: CREATE TABLE purchases ( id int not null auto_increment , card varchar(20) , description varchar(80) , amount decimal(10,2) ) with this data 1, AA, xxxxxxx, 20.45 2, BB, xxxxxxx, 3.45 3, AA, xxxxxxx, 23.45 4, AA, xxxxxxx, 11.22 5, BB, xxxxxxx, 91.77 and we want to make a report like this: CARD AA description amount (...) description amount TOTAL CARD AA: total_card CARD BB description amount (...) description amount TOTAL CARD BB: total_card TOTAL PURCHASES: total_purchases Any help would be appreciated ! Carlos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20050903/4cb628c5/attachment.html ------------------------------ Message: 8 Date: Sat, 3 Sep 2005 19:17:16 -0700 From: Anon Subject: Re: [Rails] Getting a value from datetime_select To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: <9b32a2f50509031917556b8023-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> Content-Type: text/plain; charset="iso-8859-1" snacktime wrote:> I was a little puzzled at this behavior also, and assumed I was probably > missing something. My solution was to just create a new datetime objectout> of the elements in the params date hash.I had this same problem (sent an email to this list with no response). I was able to get the date without having to access each element individually. Can''t really remember how. (another, unrelated problem I was having was when the date was out of range). I''ll post the code on Tues. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20050903/fc080465/attachment.html ------------------------------ Message: 9 Date: Sat, 3 Sep 2005 22:18:47 -0400 From: Nathan Mealey Subject: [Rails] Parent-Child Table Relationship Problems To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Message-ID: <058E806E-B0B6-4BBB-A4E5-F00523C056B1-mPKOtHdLgT0QaXB9iyTzyw@public.gmane.org> Content-Type: text/plain; charset="us-ascii" Hello, I am having trouble getting the UPDATE and CREATE functions to work with a table that has a child relationship to a parent table. The model for the Task table has a child relationship to the table Project. This is stipulated in models/task.rb with: belongs_to :project The model for the Project table has a parent relationship to the table Task. This is stipulated in models/project.rb with: has_many :tasks But when I attempt to update or create a new task, I get this error: undefined method ` project_id='' for # The error page points to controllers/task_controller.rb as the source of the error, but the MySQL request that it displays includes a value for project_id. What is wrong here? In the tutorials I have seen, they all indicate that by stipulating the parent-child relationship in the model files, the update and create statements will simply know what to do. What am I missing? Thanks in advance, Nathan -- Nathan Mealey Website Manager & Administrative Director Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 nathan-mPKOtHdLgT0QaXB9iyTzyw@public.gmane.org (413) 210-7984 (512) 681-7043 Fax -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20050903/53b73ad1/attachment.html ------------------------------ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails End of Rails Digest, Vol 12, Issue 31 ************************************* --------------------------------- DO YOU YAHOO!? 雅虎免费G邮箱-No.1的防毒防垃圾超大邮箱 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Nathan Mealey
2005-Sep-04 12:01 UTC
re:Parent-Child Table Relationship Problems (Nathan Mealey)
I should have included more info. This is the code for task.update: def update @task = Task.find(params[:id]) if @task.update_attributes(params[:task]) flash[:notice] = ''Task was successfully updated.'' redirect_to :action => ''list'' else render :action => ''edit'' end end This is the code for task.create: def create @task = Task.new(params[:task]) if @task.save flash[:notice] = ''Task was successfully created.'' redirect_to :action => ''list'' else render :action => ''new'' end end And the code in /views/task/_form.rhtml is: <p><label for="task_project">Project</label> <select name="task[ project_id]"> <% @projects.each do |project| %> <option value="">Select project</option <option value="<%= project.id %>"> <%= project.name %> </option> <% end %> </select></p> The _form displays fine, and includes the id and name for each project. I can understand that the error "undefined method for ''project_id='' looks like Rails think project_id is a method. But what I don''t understand is where this is coming from. The update and create methods look right to me... Thanks, Nathan -- Nathan Mealey Website Manager & Administrative Director Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 nathan-mPKOtHdLgT0QaXB9iyTzyw@public.gmane.org (413) 210-7984 (512) 681-7043 Fax On Sep 4, 2005, at 6:12 AM, s c wrote:> Hi Nathan, > I don''t see the code, so this is only my guess. Check if it is > task.project.id instead task.project_id. Somehow the project_id is > treated as a method that doesn''t exist. > > Sam > > rails-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org 写道: > Send Rails mailing list submissions to > rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.rubyonrails.org/mailman/listinfo/rails > or, via email, send a message with subject or body ''help'' to > rails-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > You can reach the person managing the list at > rails-owner-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rails digest..." > > > Today''s Topics: > > 1. Re: Scriptaculous: directions? (Jay Levitt) > 2. Re: RMagick problem in OS X (PJ Hyett) > 3. ordered hashes Controller -> View (Thomas Balthazar) > 4. Re: ordered hashes Controller -> View (Jorge Santiago) > 5. Re: Re: Scriptaculous: directions? (Tomas Jogin) > 6. validates_uniqueness_of for a group (Dewey Howell) > 7. Control break in Ra ils (Carlos Pavia) > 8. Re: Getting a value from datetime_select (Anon) > 9. Parent-Child Table Relationship Problems (Nathan Mealey) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 3 Sep 2005 17:03:17 -0400 > From: Jay Levitt > Subject: [Rails] Re: Scriptaculous: directions? > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Message-ID: > Content-Type: text/plain; charset="iso-8859-15" > > In article <9B6586EE-B325-4394-B00E-1F4015FA8AB6-9D208sng4xU@public.gmane.org>, thomas- > 9D208sng4xU-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says... > > I put the effects library to very good use in a (AJAX) product we > > develop. I wouldn''t have made it if I had no use for it. > > > > As an example, we put the Shake effect on the login box, when login > > fails. We''ve sliding in/out property drawers. And so on and so > forth. > > All in all we use effects on 4 or 5 occasions thr oughout the app > > where they just make the UI experience much more smooth and > enjoyable > > for the user. > > Interesting - put to those uses, I can certainly see how the effects > could help focus attention on an important control (shake), or > literally > add depth to a UI (drawers). > > Any way you could put up a demo showing those functions in their > "native > environment"? I know I just don''t have the imagination to come up with > that. Likewise, if 10 years ago you''d showed me a new library that > would draw drop-shadows around a rectangular area, I''d have thought > "Sure, that''s nice for 3D games", never thinking about its application > in a window manager. I think an awful lot of developers who are not UI > designers are going to mimic the uses they see in the demo. > > Maybe it''s as important to highlight good uses of these effects as > it is > to code them in the first place... I''d just hate for Rails to get the > reputation as "that eas y-to-use web framework with all the blinking, > moving stuff". I''m checking out the ajaxpatterns site, and it looks > pretty interesting, but of course their section on visual effects just > points back at your existing demo. > > > -- > Jay Levitt | > Wellesley, MA | I feel calm. I feel ready. I can only > Faster: jay at jay dot fm | conclude that''s because I don''t have a > http://www.jay.fm | full grasp of the situation. - Mark Adler > > > > ------------------------------ > > Message: 2 > Date: Sat, 3 Sep 2005 17:08:28 -0500 > From: PJ Hyett > Subject: Re: [Rails] RMagick problem in OS X > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Message-ID: > Content-Type: text/plain; charset=ISO-8859-1 > > My only suggestion is to look at the OS X readme that comes with the > RMagick tarball and follow it exactly step-by-step. It took me a few > tries, but I eventually figured it out. > > -PJ > http://pjhyett.com > > On 9/2/05, Pedro Valentini wrote: > > Hi, > > I''m installed ImageMagick and RMagick in an OS X and when I try to > > require RMagick lib I get this error: > > > > irb(main):001:0> require ''RMagick'' > > dyld: ruby version mismatch for library: > > /usr/X11R6/lib/libfreetype.6.dylib (compatibility version of user: > > 10.0.0 greater than library''s version: 6.3.0) > > Trace/BPT trap > > > > Someone know what can be wrong? > > Thank you > > > > -- > > > > Pedro C. Valentini > > pedro-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org > > +55 (21) 8708-8035 > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > ------------------------------ > > Message: 3 > Date: Sun, 4 Sep 2005 01:02:09 +0200 > From: Thomas Balthazar > Subject: [Rails] ordered hashes Controller -> View > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > Hi everybody, > > In my Controller, I''m doing this : > > def list > @hash_column_titles = { > ''firstname'' => "Name", > ''email'' => "E-mail", > ''role_id'' => "Role", > ''status'' => "Status" > } > end > > When I''m in my View, and that I iterate through this Hash, I get the > values in the wrong order. > > @hash_column_titles.each { |column_name, column_label| > ... > } > > Am I doing something wrong? > > What can I do the have my Hash ordered in the same way it was > declared? > > Thanks in advance for your help. > Have a nice Sunday, all! > > Thomas Balthazar. > > > > ------------------------------ > > Message: 4 > Date: Sat, 3 Sep 2005 18:14:13 -0500 > From: Jo rge Santiago > Subject: Re: [Rails] ordered hashes Controller -> View > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Message-ID: > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Thomas > > Hashes dont respect any order. You have to use an Array. > > > santiago. > > On 9/3/05, Thomas Balthazar wrote: > > Hi everybody, > > > > In my Controller, I''m doing this : > > > > def list > > @hash_column_titles = { > > ''firstname'' => "Name", > > ''email'' => "E-mail", > > ''role_id'' => "Role", > > ''status'' => "Status" > > } > > end > > > > When I''m in my View, and that I iterate through this Hash, I get the > > values in the wrong order. > > > > @hash_column_titles.each { |column_name, column_label| > > ... > > } > > > > Am I doing something wrong? > > > > What can I do the have my Ha sh ordered in the same way it was > declared? > > > > Thanks in advance for your help. > > Have a nice Sunday, all! > > > > Thomas Balthazar. > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > ------------------------------ > > Message: 5 > Date: Sun, 4 Sep 2005 01:39:45 +0200 > From: Tomas Jogin > Subject: Re: [Rails] Re: Scriptaculous: directions? > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Message-ID: <8c05e657050903163936f66d27-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> > Content-Type: text/plain; charset=ISO-8859-1 > > > Interesting - put to those uses, I can certainly see how the effects > > could help focus attention on an important control (shake), or > literally > > add depth to a UI (drawers). > > > > Any way you could put up a demo showing those functions in their > "native > > environment"? I know I just don''t have the imagination to come up > with > > that. > > Both those examples are adaptations of UI elements in Mac OS X (which > I too have shamelessly copied in my apps). So for a demo, check out > Mac OS X (the adaptation to the web will be left for you to imagine). > > Without the use of Ajax, those effects might very well be pointless > and over-the-top, but in an Ajaxified interface, lacking the normal > browser reload user feedback, as David suggested earlier, those > effects are absolutely necessary in order to provide a userfriendly > interface. An ajax implementation _without_ those effects would be > poor and half-assed. > > Regards, > Tomas Jogin > > > ------------------------------ > > Message: 6 > Date: Sat, 3 Sep 2005 18:48:24 -0700 > From: Dewey Howell > Subject: [Rails] validates_uniqueness_of for a group > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Message-ID: <107869500509031848a55da48-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi > > I have 2 questions: > > I want to validate that 3 fields together must be unique. e.g - > first_name, last_name and birth_date. > > To ensure 2 fields are unique as a group I can do this: > > validates_uniqueness_of :first_name, :scope => "last_name" > > 1) How do I add the third term so that all three are checked together? > > Just to ensure my question is clear: > > ---John Smith DOB 4/4/1970 and John Smith DOB 4/4/1980 would be > allowed but not if all three fields matched. > > > 2) How do I set it to highlight all three fields but only output one > message like "First name, last name & birth date must be unique" > > Thanks, > Dewey > > > ------------------------------ > > Message: 7 > Date: Sat, 3 Sep 2005 22:57:32 -0300 > From: Carlos Pavia > Subject: [Rails] Control break in Rails > To : rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Message-ID: <7a4512630509031857404a5ff-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> > Content-Type: text/plain; charset="iso-8859-1" > > What is the best way to implement a control break, in Rails ? > Suppose we have a table: > > CREATE TABLE purchases ( > id int not null auto_increment , > card varchar(20) , > description varchar(80) , > amount decimal(10,2) > ) > > with this data > > 1, AA, xxxxxxx, 20.45 > 2, BB, xxxxxxx, 3.45 > 3, AA, xxxxxxx, 23.45 > 4, AA, xxxxxxx, 11.22 > 5, BB, xxxxxxx, 91.77 > > > and we want to make a report like this: > > CARD AA > description amount > (...) > description amount > > TOTAL CARD AA: total_card > > > CARD BB > description amount > (...) > description amount > > TOTAL CARD BB: total_card > > TOTAL PURCHASES: total_purchases > > > Any help would be appreciated ! > > > Carlos > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/ > 20050903/4cb628c5/attachment.html > > ------------------------------ > > Message: 8 > Date: Sat, 3 Sep 2005 19:17:16 -0700 > From: Anon > Subject: Re: [Rails] Getting a value from datetime_select > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Message-ID: <9b32a2f50509031917556b8023-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> > Content-Type: text/plain; charset="iso-8859-1" > > snacktime wrote: > > I was a little puzzled at this behavior also, and assumed I was > probably > > missing something. My solution was to just create a new datetime > object > out > > of the elements in the params date hash. > > I had this same problem (sent an email to this list with no > response). I was > able to get the date without having to access each element > individually. > Can''t really remember how. (another, unrelated problem I was having > was when > the date was out of range). > > I''ll post the code on Tues. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/ > 20050903/fc080465/attachment.html > > ------------------------------ > > Message: 9 > Date: Sat, 3 Sep 2005 22:18:47 -0400 > From: Nathan Mealey > Subject: [Rails] Parent-Child Table Relationship Problems > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Message-ID: <058E806E-B0B6-4BBB-A4E5-F00523C056B1-mPKOtHdLgT0QaXB9iyTzyw@public.gmane.org> > Content-Type: text/plain; charset="us-ascii" > > Hello, > > I am having trouble getting the UPDATE and CREATE functions to work > with a table that has a child relationship to a parent table. > > The model for the Task table has a child relationship to the table > Project. This is stipulated in models/task.rb with: > belongs_to :project > > The model for the Project table has a parent relationship to the > table Task. This is stipulated in models/project.rb with: > has_many :tasks > > But when I attempt to update or create a new task, I get this error: > undefined method ` project_id='' for # > > The error page points to controllers/task_controller.rb as the source > of the error, but the MySQL request that it displays includes a value > for project_id. > > What is wrong here? In the tutorials I have seen, they all indicate > that by stipulating the parent-child relationship in the model files, > the update and create statements will simply know what to do. > > What am I missing? > > Thanks in advance, > Nathan > -- > Nathan Mealey > Website Manager & Administrative Director > Cycle-Smart, Inc. > P.O. Box 1482 > Northampton, MA > 01061-1482 > nathan-mPKOtHdLgT0QaXB9iyTzyw@public.gmane.org > (413) 210-7984 > (512) 681-7043 Fax > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/ > 20050903/53b73ad1/attachment.html > > ------------------------------ > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > End of Rails Digest, Vol 12, Issue 31 > ************************************* > > DO YOU YAHOO!? > 雅虎免费G邮箱-No.1的防毒防垃圾超大邮箱 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails