Hi --

On Sat, 4 Oct 2008, Rob Lacey wrote:

> Palani Kumar wrote:
>> Hi,
>>  Can anyone please tell me the difference between save & save!() method
>>
>
> Anything with an exclamation with raise an error if it is not
> successful, without an exclamation it will just return false
>
> RobL

I'd just add, to clarify, that that's a Rails idiom, not a
Ruby-language one (i.e., the ! doesn't actually cause the error).

Anyone who's interested can find an in-depth explanation of !-methods
here:

http://dablog.rubypal.com/2007/8/15/bang-methods-or-danger-will-rubyist

That post talks about the Ruby conventions, as delineated by Matz and
practiced in Ruby itself. Rails doesn't follow those conventions but,
with all due respect to the Rails team, I wish it did :-) and I
strongly recommend following the conventions when you choose method
names in your own code.


David

-- 
Rails training from David A. Black and Ruby Power and Light:
   Intro to Ruby on Rails  January 12-15   Fort Lauderdale, FL
   Advancing with Rails    January 19-22   Fort Lauderdale, FL *
   * Co-taught with Patrick Ewing!
See http://www.rubypal.com for details and updates!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to