In an early section on Action View, showing code being put directly into the rhtml file: <% require ''date'' DAY_NAMES = %w{ Sunday Monday Tuesday Wednesday Thursday Friday Saturday } today = Date.today %> <h1>Hello, Dave</h1> <p> It''s <%= DAY_NAMES[today.wday] %>. Tomorrow is <%= DAY_NAMES[(today + 1).wday %>. </p> I get this error - compile error ./script/../config/../app/views/signup/registration.rhtml:2: dynamic constant assignment DAY_NAMES = %w{ Sunday Monday Tuesday Wednesday Thursday Friday Saturday } ^ ./script/../config/../app/views/signup/registration.rhtml:8: parse error, unexpected '')'', expecting '']'' _erbout.concat "Tomorrow is "; _erbout.concat(( DAY_NAMES[(today + 1).wday ).to_s); _erbout.concat ".\n" Something wrong with declaring the constant ? Stuart
Hi -- On Sat, 15 Jul 2006, Dark Ambient wrote:> In an early section on Action View, showing code being put directly > into the rhtml file: > > <% require ''date'' > DAY_NAMES = %w{ Sunday Monday Tuesday Wednesday Thursday Friday Saturday } > today = Date.today %> > > <h1>Hello, Dave</h1> > <p> > It''s <%= DAY_NAMES[today.wday] %>. > Tomorrow is <%= DAY_NAMES[(today + 1).wday %>.You''re missing a ] on that last line, after wday. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy http://www.manning.com/black => RUBY FOR RAILS (reviewed on Slashdot, 7/12/2006!) http://dablog.rubypal.com => D[avid ]A[. ]B[lack''s][ Web]log dblack@wobblini.net => me
On 7/15/06, dblack@wobblini.net <dblack@wobblini.net> wrote:> Hi -- > > On Sat, 15 Jul 2006, Dark Ambient wrote: > > > In an early section on Action View, showing code being put directly > > into the rhtml file: > > > > <% require ''date'' > > DAY_NAMES = %w{ Sunday Monday Tuesday Wednesday Thursday Friday Saturday } > > today = Date.today %> > > > > <h1>Hello, Dave</h1> > > <p> > > It''s <%= DAY_NAMES[today.wday] %>. > > Tomorrow is <%= DAY_NAMES[(today + 1).wday %>. > > You''re missing a ] on that last line, after wday. > > > DavidI would have felt bad if I posted to the list for a typo but that didn''t seem to be the issue. It''s something related to declaring a constant. When I switchd DAY_NAMES to day_names the code worked. What up with dat ? Stuart
Hi -- On Sat, 15 Jul 2006, Dark Ambient wrote:> On 7/15/06, dblack@wobblini.net <dblack@wobblini.net> wrote: >> Hi -- >> >> On Sat, 15 Jul 2006, Dark Ambient wrote: >> >> > In an early section on Action View, showing code being put directly >> > into the rhtml file: >> > >> > <% require ''date'' >> > DAY_NAMES = %w{ Sunday Monday Tuesday Wednesday Thursday Friday Saturday >> } >> > today = Date.today %> >> > >> > <h1>Hello, Dave</h1> >> > <p> >> > It''s <%= DAY_NAMES[today.wday] %>. >> > Tomorrow is <%= DAY_NAMES[(today + 1).wday %>. >> >> You''re missing a ] on that last line, after wday. >> >> >> David > > I would have felt bad if I posted to the list for a typo but that > didn''t seem to be the issue. > It''s something related to declaring a constant. When I switchd > DAY_NAMES to day_names the code worked. What up with dat ?I''d only tried running it through ERb with the typo fixed, which worked -- but experimenting a little more, it does indeed seem to be true that when ActionPack does its rendering, constant assignments are regarded as dynamic, which isn''t allowed. ("def x; A=1; end" won''t even parse.) So this is a case where there''s a difference between command-line erb and the erb that''s taking place programmatically in the course of rendering. You can, if you really want to, get around this with const_set, but there''s probably no occasion where you''d really have a good reason to define a constant in a view template. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy http://www.manning.com/black => RUBY FOR RAILS (reviewed on Slashdot, 7/12/2006!) http://dablog.rubypal.com => D[avid ]A[. ]B[lack''s][ Web]log dblack@wobblini.net => me
Right, the whole example was basically to show what not to do :) of course more eloquently demonstrated with purpose. Thank you for checking and the explanation! Stuart On 7/15/06, dblack@wobblini.net <dblack@wobblini.net> wrote:> Hi -- > > On Sat, 15 Jul 2006, Dark Ambient wrote: > > > On 7/15/06, dblack@wobblini.net <dblack@wobblini.net> wrote: > >> Hi -- > >> > >> On Sat, 15 Jul 2006, Dark Ambient wrote: > >> > >> > In an early section on Action View, showing code being put directly > >> > into the rhtml file: > >> > > >> > <% require ''date'' > >> > DAY_NAMES = %w{ Sunday Monday Tuesday Wednesday Thursday Friday Saturday > >> } > >> > today = Date.today %> > >> > > >> > <h1>Hello, Dave</h1> > >> > <p> > >> > It''s <%= DAY_NAMES[today.wday] %>. > >> > Tomorrow is <%= DAY_NAMES[(today + 1).wday %>. > >> > >> You''re missing a ] on that last line, after wday. > >> > >> > >> David > > > > I would have felt bad if I posted to the list for a typo but that > > didn''t seem to be the issue. > > It''s something related to declaring a constant. When I switchd > > DAY_NAMES to day_names the code worked. What up with dat ? > > I''d only tried running it through ERb with the typo fixed, which > worked -- but experimenting a little more, it does indeed seem to be > true that when ActionPack does its rendering, constant assignments are > regarded as dynamic, which isn''t allowed. ("def x; A=1; end" won''t > even parse.) So this is a case where there''s a difference between > command-line erb and the erb that''s taking place programmatically in > the course of rendering. > > You can, if you really want to, get around this with const_set, but > there''s probably no occasion where you''d really have a good reason to > define a constant in a view template. > > > David > > -- > http://www.rubypowerandlight.com => Ruby/Rails training & consultancy > http://www.manning.com/black => RUBY FOR RAILS (reviewed on > Slashdot, 7/12/2006!) > http://dablog.rubypal.com => D[avid ]A[. ]B[lack''s][ Web]log > dblack@wobblini.net => me > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Jul 15, 2006, at 8:43 PM, Dark Ambient wrote:> Right, the whole example was basically to show what not to do :) of > course more eloquently demonstrated with purpose. > Thank you for checking and the explanation!And I changed it to use a local variable thanks to this thread. Dave
When I run the command mysql_config --socket, I get command not found error message. Is this command correct? I am on MacOS. TIA.
On 7/28/06, Bala Paranj <bparanj@yahoo.com> wrote:> > When I run the command mysql_config --socket, I get command not found > error message. Is this command correct?Try the full path to mysql_config, go to Terminal and type ''find / -name ''mysql*_config'' -print'' to find this path out. -- Cheers, Hasan Diwan <hasan.diwan@gmail.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060729/218efe9a/attachment.html
I''ve been working my way through AWDWR (beta pdf), and have gotten through to page 137. Just to be sure I''m not "chasing the wrong dog", I thought I''d post and see if others have come across the same situation. The code appears to be working fine to this point with the following exception: When any of the "Add to cart" buttons are selected the AJAX section of the page (the left side displaying the cart contents and totals) does not update (redisplay). I know the information has been recorded because when I manually refresh the page, the contents of the cart are updated.>From what I read, it seems as though the rails app should be redisplayingthis section of the page each time an item is added to the cart. My browser is Mozilla Firefox 1.5.0.5. I know the browser supports AJAX requests, and I get the same results when using IE 6.0.2900.2180, which also supports AJAX (in the Windose way). Have others had the same experience or where should I look to resolve this issue? OR Have I misunderstood how this application is supposed to work? TIA for any and all responses. -- Steve
Steve, Re-start your web-server ( webbrick/mongrel ) and try again. It worked for me. Thanks, VS. unknown wrote:> I''ve been working my way through AWDWR (beta pdf), and have gotten > through > to page 137. > > Just to be sure I''m not "chasing the wrong dog", I thought I''d post and > see if others have come across the same situation. > > The code appears to be working fine to this point with the following > exception: > > When any of the "Add to cart" buttons are selected the AJAX section of > the > page (the left side displaying the cart contents and totals) does not > update (redisplay). > > I know the information has been recorded because when I manually refresh > the page, the contents of the cart are updated. >>From what I read, it seems as though the rails app should be redisplaying > this section of the page each time an item is added to the cart. > > My browser is Mozilla Firefox 1.5.0.5. I know the browser supports AJAX > requests, and I get the same results when using IE 6.0.2900.2180, which > also supports AJAX (in the Windose way). > > Have others had the same experience or where should I look to resolve > this > issue? OR Have I misunderstood how this application is supposed to work? > > TIA for any and all responses. > > -- Steve-- Posted via http://www.ruby-forum.com/.
On Aug 9, 2006, at 5:11, rails@maintenancemode.com wrote:> > The code appears to be working fine to this point with the following > exception: > > When any of the "Add to cart" buttons are selected the AJAX section > of the > page (the left side displaying the cart contents and totals) does not > update (redisplay).Have you included the javascript libraries in the store layout? Does the code that''s downloadable from the book''s site work OK for you? Regards Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060810/6704422d/attachment.html
An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060810/48bd0fbd/attachment.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060810/48bd0fbd/store.html
On Aug 10, 2006, at 12:02, Steve Downie wrote:> You can get to my version of the application at: http:// > 24.23.248.71:3000/store/Yes, it fails here too, which means it isn''t a browser issue. You next step is to download the source code for the book and run it. Then find out how it differs form yours. Regards Dave Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060810/3482b458/attachment.html
Please send text only mails. It increases the chances that more people will be able to understand your problem and help you. Steve Downie <rails@maintenancemode.com> writes:> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <html> > <head> > <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> > <title></title> > </head> > <body bgcolor="#ffffff" text="#000000"> > Dave Thomas wrote: > <blockquote cite="mid69FAF4D5-5DAF-4FED-8F43-720A5DD57683@pragprog.com" > type="cite"><br> > <div> > <div>On Aug 9, 2006, at 5:11, <a > href="mailto:rails@maintenancemode.com">rails@maintenancemode.com</a> > wrote:</div> > <br class="Apple-interchange-newline"> > <blockquote type="cite"> > <p > style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"><br> > </p> > <p style="margin: 0px;"><font > style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" > face="Helvetica" size="3">The code appears to be working fine to this > point with the following</font></p> > <p style="margin: 0px;"><font > style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" > face="Helvetica" size="3">exception:</font></p> > <p > style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"><br> > </p> > <p style="margin: 0px;"><font > style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" > face="Helvetica" size="3">When any of the "Add to cart" buttons are > selected the AJAX section of the</font></p> > <p style="margin: 0px;"><font > style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" > face="Helvetica" size="3">page (the left side displaying the cart > contents and totals) does not</font></p> > <p style="margin: 0px;"><font > style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" > face="Helvetica" size="3">update (redisplay).</font></p> > </blockquote> > </div> > <br> > <div><br class="khtml-block-placeholder"> > </div> > <div>Have you included the javascript libraries in the store layout?</div> > <div><br class="khtml-block-placeholder"> > </div> > <div>Does the code that''s downloadable from the book''s site work OK > for you?</div> > <div><br class="khtml-block-placeholder"> > </div> > <div><br class="khtml-block-placeholder"> > </div> > <div>Regards</div> > <div><br class="khtml-block-placeholder"> > </div> > <div><br class="khtml-block-placeholder"> > </div> > <div>Dave</div> > </blockquote> > <font face="Arial">Dave,<br> > <br> > You can get to my version of the application at: > <a class="moz-txt-link-freetext" href="http://24.23.248.71:3000/store/">http://24.23.248.71:3000/store/</a><br> > <br> > I believe that all javascript libraries are included. I''ve used your > downloadable code with only minor changes to the text and .css files. > Functionally, everything works as advertised save this AJAX anomaly. > I''ve attached a copy of "store.html" which is the output from my > version of the rails app. Perhaps you can spot something that I''m > missing in the output. The "Empty cart" action works dynamically, but > the "Add to cart" buttons on the right side do not dynamically update > the AJAX section of the page on the left side. When the page is > refreshed manually, all orders are updated correctly. Which files > should I be looking at to chase down this anomaly? Or could it be > something related to "edge rails" and AJAX? I<br> > <br> > I''ve checked the development.log file and there are no errors > indicated. I''ve continued to go through the book and I''m up to the > Testing section. Everything else seems to work just fine, but the > application continues to have this AJAX update problem. I was actually > hoping that it was a common issue and that it would be fixed with an > update to the current version of the book or the supporting code.<br> > <br> > Let me know if you need anything else from me that would help pinpoint > the cause. I''m particularly interested in getting the AJAX part of the > code to work, as it will be a crucial part of my next project.<br> > <br> > And kudos to you for this great book. We need more tutorials like this > and I appreciate the time and effort you put into making this both a > great read and a great tutorial.<br> > <br> > Warm regards,<br> > <br> > </font> > <div class="moz-signature">-- <br> > <font face="Helvetica, Arial, sans-serif"> > Steve Downie > </font><br> > <font face="Arial Narrow"><b>M A I N T E N A N C E M O D E, I N C.</b></font><br> > <font color="#666666" face="Arial">Software Consulting Services</font><br> > <font face="Arial Narrow" size="4">Voice: (408) 777-0300 Fax: (408) > 777-0301</font><br> > <font face="Arial Narrow" size="3"></font></div> > <br> > </body> > </html> > > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <!-- > ! Excerpted from "Agile Web Development with Rails, 2nd Ed." > ! We make no guarantees that this code is fit for any purpose. > ! Visit http://www.pragmaticprogrammer.com/titles/rails2 for more book information. > --> > <html> > <head> > <title>Pragprog Books Online Store</title> > <link href="/stylesheets/depot.css?1155223397" media="all" rel="Stylesheet" type="text/css" /> > <script src="/javascripts/prototype.js?1155069466" type="text/javascript"></script> > <script src="/javascripts/effects.js?1155069466" type="text/javascript"></script> > <script src="/javascripts/dragdrop.js?1155069466" type="text/javascript"></script> > <script src="/javascripts/controls.js?1155069466" type="text/javascript"></script> > <script src="/javascripts/application.js?1154804698" type="text/javascript"></script> > </head> > <body id="store"> > <div id="banner"> > Maintenance Mode Market > </div> > <div id="columns"> > <div id="side"> > > <!-- START_HIGHLIGHT --> > <div id="cart"> > <!-- > ! Excerpted from "Agile Web Development with Rails, 2nd Ed." > ! We make no guarantees that this code is fit for any purpose. > ! Visit http://www.pragmaticprogrammer.com/titles/rails2 for more book information. > --> > <div class="cart-title" >Your Cart</div> > <table> > <!-- > ! Excerpted from "Agile Web Development with Rails, 2nd Ed." > ! We make no guarantees that this code is fit for any purpose. > ! Visit http://www.pragmaticprogrammer.com/titles/rails2 for more book information. > --> > <tr> > <td>1×</td> > <td>Longer Title</td> > <td class="item-price">$5.43</td> > </tr> > <!-- > <= button_to "Empty cart" , :action => :empty_cart > > --> > > > <tr class="total-line" > > <td colspan="2" >Total</td> > <td class="total-cell" >$5.43</td> > </tr> > </table> > <form method="post" action="/store/checkout" class="button-to"><div><input type="submit" value="Checkout" /></div></form> > <form method="post" action="/store/empty_cart" class="button-to"><div><input type="submit" value="Empty cart" /></div></form> > > > </div> > <!-- END_HIGHLIGHT --> > > <a href="http://www....">Home</a><br /> > <a href="http://www..../faq">Questions</a><br /> > <a href="http://www..../news">News</a><br /> > <a href="http://www..../contact">Contact</a><br /> > </div> > <div id="main"> > > > <!-- > ! Excerpted from "Agile Web Development with Rails, 2nd Ed." > ! We make no guarantees that this code is fit for any purpose. > ! Visit http://www.pragmaticprogrammer.com/titles/rails2 for more book information. > --> > > <h1>Products</h1> > > <div class="entry"> > <img src="/images/mmode30.gif" alt="product image" /> > <h3>MMode logo</h3> > <p>This is a logo for the infamous company called "Maintenance Mode". This logo is a collector''s item and should continue to appreciate in value for years to come.</p><br /> > <span class="price">$32.50</span> > > <form action="/store/add_to_cart/1" method="post" onsubmit="new Ajax.Request(''/store/add_to_cart/1'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;"> > <input name="commit" type="submit" value="Add to Cart" /> > </form> > > </div> > <div class="entry"> > <img src="/images/shpiano.gif" alt="product image" /> > <h3>Music Literature</h3> > This is historical text, documenting the music of the 17th, 18th, and 19th centuries. a must for any classical music buff. It details the common styles of each period and how they continued to evolve.<br /><br /> > <span class="price">$5.43</span> > > <form action="/store/add_to_cart/5" method="post" onsubmit="new Ajax.Request(''/store/add_to_cart/5'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;"> > <input name="commit" type="submit" value="Add to Cart" /> > </form> > > </div> > <div class="entry"> > <img src="/images/13-www.gif" alt="product image" /> > <h3>Pragmatic Version Control</h3> > <p>This book is a recipe-based approach to using Subversion that will get you up and running quickly--and correctly. All projects need version control: it''s a foundational piece of any project''s infrastructure. Yet half of all project teams in the U.S. don''t use any version control at all.</p> > <span class="price">$28.50</span> > > <form action="/store/add_to_cart/2" method="post" onsubmit="new Ajax.Request(''/store/add_to_cart/2'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;"> > <input name="commit" type="submit" value="Add to Cart" /> > </form> > > </div> > > > > </div> > </div> > </body> > </html> > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-- Surendra Singhi http://ssinghi.kreeti.com, http://www.kreeti.com Read my blog at: http://cuttingtheredtape.blogspot.com/ ,---- | "All animals are equal, but some animals are more equal than others." | -- Orwell, Animal Farm, 1945 `----
I just came across this same issue, I am working with Edge rails and debugged it down to the "==". Try replacing: cart_item == @current_item with with: cart_item.equal?(@current_item) I believe that == may have been overwritten. Cesar On 8/10/06, Dave Thomas <dave@pragprog.com> wrote:> > > On Aug 10, 2006, at 12:02, Steve Downie wrote: > > You can get to my version of the application at: > http://24.23.248.71:3000/store/ > > > > Yes, it fails here too, which means it isn''t a browser issue. > > You next step is to download the source code for the book and run it. Then > find out how it differs form yours. > > > Regards > > > Dave Thomas > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060815/203cd0e4/attachment.html
On Aug 14, 2006, at 8:40 PM, Cesar Ho wrote:> I just came across this same issue, I am working with Edge rails > and debugged it down to the "==". > Try replacing: > cart_item == @current_item with > with: > cart_item.equal?(@current_item) > > I believe that == may have been overwritten. >Whoa! I hope not. Let me dg into this the next time I have the chapter opened up. Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060815/c4205f34/attachment.html
I downloaded the code and was able to run it successfully without replacing the "==" with "equal?" so it may have to do with some gem/engine I may have installed. It''s strange "==" and "equal" should be synonymous, and it works on a single product but not when multiple products are added to the same cart. I''ll try to reproduce the bug with something else. Cesar On 8/14/06, Dave Thomas <dave@pragprog.com> wrote:> > > On Aug 14, 2006, at 8:40 PM, Cesar Ho wrote: > > I just came across this same issue, I am working with Edge rails and > debugged it down to the "==". > Try replacing: > cart_item == @current_item with > with: > cart_item.equal?(@current_item) > > I believe that == may have been overwritten. > > > > Whoa! I hope not. Let me dg into this the next time I have the chapter > opened up. > > > Dave > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060815/f9f7096b/attachment.html
I found it! :D Silly mistake should have done a diff on the file instead of the class contents! For the CartItem model, I used the generate model script which made it inherit the ActiveRecord class. Removing ActiveRecord fixes the problem. ActiveRecord obviously redefines "==", I guess the most obvious mistakes are the hardest to find. Cesar On 8/14/06, Cesar Ho <cesarho@gmail.com> wrote:> > I downloaded the code and was able to run it successfully without > replacing the "==" with "equal?" so it may have to do with some gem/engine I > may have installed. It''s strange "==" and "equal" should be synonymous, and > it works on a single product but not when multiple products are added to the > same cart. > > I''ll try to reproduce the bug with something else. > > Cesar > > On 8/14/06, Dave Thomas <dave@pragprog.com > wrote: > > > > > On Aug 14, 2006, at 8:40 PM, Cesar Ho wrote: > > > > I just came across this same issue, I am working with Edge rails and > > debugged it down to the "==". > > Try replacing: > > cart_item == @current_item with > > with: > > cart_item.equal?(@current_item) > > > > I believe that == may have been overwritten. > > > > > > > > Whoa! I hope not. Let me dg into this the next time I have the chapter > > opened up. > > > > > > Dave > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060815/82b4f363/attachment.html