[Rails] Re: only one error message for a field

2008-11-20 Thread Robert Zotter
if the attribute is blank (default is false). http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M001639 You will probably want to use allow_blank because if you create an email via params it could come back as an empty string. -- Robert Zotter Zapient, LLC Ruby on Rails

[Rails] Re: :only and :except not working for map.resources

2008-11-15 Thread Robert Zotter
Nick, The :except and :only routing options are only available on Edge Rails (Rails 2.2.1 or Rails 2.2 RC2) at this time. Make sure you are running the correct version. Cheers -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http://www.zapient.com http

[Rails] Re: toggle the caption of a link

2008-11-13 Thread Robert Zotter
') { ... } Or you could set some arbitrary attribute on the div and check it ie... div id='show_archive' expanded='true' %/div if ($('show_archive').readAttribute('expanded') == 'true') { ... } Cheers. -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http://www.zapient.com http

[Rails] Re: creating empty array of items - should be a quick simple one

2008-11-06 Thread Robert Zotter
/Array.html#M002232 Cheers -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http://www.zapient.com http://www.fromjavatoruby.com On Nov 6, 8:01 pm, Scott Kulik [EMAIL PROTECTED] wrote: here is some of the code:     @items_all = Item.find(:all)     for item in @items_all

[Rails] Re: creating empty array of items - should be a quick simple one

2008-11-06 Thread Robert Zotter
I probably should mention the best way to do what you are trying to accomplish would be: @items_missing_images = @items_all.reject { |item| FileTest.exist? (item.image_name) } -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http://www.zapient.com http

[Rails] Re: auto-complete without connecting to the server

2008-11-05 Thread Robert Zotter
autocompleter wiki, it has all the information you will need. http://github.com/madrobby/scriptaculous/wikis/autocompleter-local Cheers -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http://www.zapient.com http://www.fromjavatoruby.com On Nov 5, 9:03 am, Sam Kong [EMAIL

[Rails] Re: auto-complete without connecting to the server

2008-11-05 Thread Robert Zotter
Typo ...maybe there is one someone -- ...maybe there is one somewhere. On Nov 5, 9:24 am, Robert Zotter [EMAIL PROTECTED] wrote: Sam, I am unaware of any plugins for this, maybe there is one someone. Fortunately though It is trivial to implement with the Scriptaculous library. Basically

[Rails] Re: DateTime in Linux

2008-11-03 Thread Robert Zotter
Try this. evt.start_time.in_time_zone('Arizona') Check out http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Time/Zones.html. And http://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html lists all the available timezones. -- Robert Zotter Zapient, LLC Ruby on Rails

[Rails] Re: DateTime in Linux

2008-10-31 Thread Robert Zotter
Charles, I am not sure what you want to accomplish. If you want to display the time you have listed in your database you can always use the following. %= h evt.start_time.to_s(:db) % Is this what you are looking for? -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http

[Rails] Re: to_xml associations and :only

2008-10-29 Thread Robert Zotter
the :skip_instruct = true option when you are creating the xml for your associations so it does not add the XML declaration ?xml version=1.0 ... Cheers. -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http://www.zapient.com http://www.fromjavatoruby.com On Oct 28, 8:16 am, Marcelo

[Rails] Re: aasm callback order?

2008-10-27 Thread Robert Zotter
respectively which are passed in during instantiation. Cheers -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http://www.zapient.com http://www.fromjavatoruby.com On Oct 27, 5:31 pm, Danimal [EMAIL PROTECTED] wrote: Hello! Sometime ago I ran across a webpage where

[Rails] Re: aasm callback order?

2008-10-27 Thread Robert Zotter
Ahhh I see. Sorry, Im not familiar with that wiki you are talking about. However I can solve your bookmarking problem if you happen to use Firefox http://www.foxmarks.com/ :) Good luck finding that wiki. -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http

[Rails] Re: Reading n writing object attributes

2008-10-27 Thread Robert Zotter
Soh, Not sure why you are not able to access the attributes in the use case but can I ask why you are not using the dynamic find_by methods ie User.find_by_username('kena') ? -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting On Oct 27, 6:49 pm, Soh Dubom [EMAIL PROTECTED

[Rails] Re: what is !map:HashWithIndifferentAccess ?

2008-10-25 Thread Robert Zotter
'somekey' is not the same as the key :somekey hash = HashWithIndifferentAccess.new({:somekey = 'testing'}) hash[:somekey] = 'testing' hash['somekey'] = 'testing' Here the key 'somekey' and :somekey are the same. Understand? -- Robert Zotter Zapient, LLC Ruby on Rails Development