hey, i just want a list of time zones and the one from the user table must be selected (all ''Brussels'' in database. <select name="firm[gmt_zone_id]"> <%= time_zone_options_for_select(selected = ''Brussels'', priority_zones = [''Brussels'',''Amsterdam''], model = TimeZone) %><br /> </select> this is my error Showing /account/edit_firm.rhtml where line #41 raised: undefined method `name'' for "Brussels":String Extracted source (around line #41): 38: <td>Timezone:</td> 39: <td> 40: <select name="firm[gmt_zone_id]"> 41: <%= time_zone_options_for_select(selected = ''Brussels'', priority_zones = [''Brussels'',''Amsterdam''], model = TimeZone) %><br /> 42: </select> 43: </td> 44: </tr> Show template trace c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/helpers/form_options_helper.rb:232:in `time_zone_options_for_select'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/helpers/form_options_helper.rb:232:in `map'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/helpers/form_options_helper.rb:232:in `time_zone_options_for_select'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/helpers/form_options_helper.rb:232:in `[]'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/helpers/form_options_helper.rb:235:in `time_zone_options_for_select'' (erb):41:in `evaluate_locals'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:272:in `evaluate_locals'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:283:in `rhtml_render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:208:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:208:in `render_template'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:173:in `render_file'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:588:in `render_with_no_layout'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:216:in `render_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:591:in `render_with_no_layout'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:216:in `render_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:604:in `render_with_no_layout'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:216:in `render_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:627:in `render_with_no_layout'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:210:in `render_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:757:in `perform_action_without_filters'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in `perform_action_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in `handle_dispatch'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch'' script/server:49
hey, then i need to get the gtm_zone out of the database i this case ''Brussels'' , but then i only have the name, not the time difference. i need to get the difference, to get the current time and date depending on which gtmzone. thanks
Hi ! 2005/10/19, Nick Brutyn <brutyn_nick@hotmail.com>:> Showing /account/edit_firm.rhtml where line #41 raised: > undefined method `name' for "Brussels":String > Extracted source (around line #41): > > 38: <td>Timezone:</td> > 39: <td> > 40: <select name="firm[gmt_zone_id]"> > 41: <%= time_zone_options_for_select(selected = 'Brussels', priority_zones > = ['Brussels','Amsterdam'], model = TimeZone) %><br />The currently selected timezone must be a timezone object, not the name of the timezone. That's why Rails is reporting an undefined method - it's trying to get the timezone's name, but it can't. Hope that helps, François _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
hey, the selected timezone works, but the priority_zones doesnt>From: Francois Beausoleil <francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >Reply-To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >Subject: Re: [Rails] timezone problem with select >Date: Wed, 19 Oct 2005 09:03:21 -0400 > >Hi ! > >2005/10/19, Nick Brutyn <brutyn_nick-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>: > > Showing /account/edit_firm.rhtml where line #41 raised: > > undefined method `name'' for "Brussels":String > > Extracted source (around line #41): > > > > 38: <td>Timezone:</td> > > 39: <td> > > 40: <select name="firm[gmt_zone_id]"> > > 41: <%= time_zone_options_for_select(selected = ''Brussels'', >priority_zones > > = [''Brussels'',''Amsterdam''], model = TimeZone) %><br /> > >The currently selected timezone must be a timezone object, not the >name of the timezone. > >That''s why Rails is reporting an undefined method - it''s trying to get >the timezone''s name, but it can''t. > >Hope that helps, >François>_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails