From: Vorik <goo...@gerapeldoorn.nl>
Date: Tue, 24 Apr 2007 22:59:05 -0700
Local: Wed, Apr 25 2007 1:59 am
Subject: Re: How to use start_year and end_year on a date column
Here's the trace that is generated when I put this in app/helpers/
admin/leerling_helper.rb: ---------------%<--------------- module Admin::LeerlingHelper def geboortedatum_form_column(record, input_name) select_date :record, :name => input_name, :order => [:day, :month, :year], :start_year => 1970, :end_year => 2000 end end ---------------%<--------------- trace: ---------------%<--------------- ActionView::TemplateError (undefined method `day' for :record:Symbol) on line #3 of vendor/plugins/active_scaffold/frontends/default/views/ _form_attribute.rhtml: 1: <% scope ||= nil %> 2: <label for="<%= "record_#{column.name}" %>"><%= column.label %></ label> 3: <%= form_column column, scope %> 4: <% if column.description -%> 5: <span class="description"><%= column.description %></span> 6: <% end -%> /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ helpers/date_helper.rb:229:in `select_day' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ helpers/date_helper.rb:155:in `select_date' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ helpers/date_helper.rb:154:in `select_date' #{RAILS_ROOT}/app/helpers/admin/leerling_helper.rb:3:in `geboortedatum_form_column' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/helpers/ form_helpers.rb:46:in `form_column' #{RAILS_ROOT}/vendor/plugins/active_scaffold/frontends/default/ views/_form_attribute.rhtml:3:in `_run_rhtml_47vendor47plugins47active_scaffold47frontends47default47views47 _form_attribute46rhtml' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:326:in `compile_and_render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:301:in `render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:260:in `render_file' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:275:in `render_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:45:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ partials.rb:59:in `render_partial_without_active_scaffold' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:26:in `benchmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:26:in `benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ partials.rb:58:in `render_partial_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:55:in `render_partial' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:287:in `render_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:45:in `render' #{RAILS_ROOT}/vendor/plugins/active_scaffold/frontends/default/ views/_form.rhtml:14:in `_run_rhtml_47vendor47plugins47active_scaffold47frontends47default47views47 _form46rhtml' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/data_structures/ action_columns.rb:65:in `each' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/data_structures/ action_columns.rb:52:in `each' #{RAILS_ROOT}/vendor/plugins/active_scaffold/frontends/default/ views/_form.rhtml:2:in `_run_rhtml_47vendor47plugins47active_scaffold47frontends47default47views47 _form46rhtml' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:326:in `compile_and_render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:301:in `render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:260:in `render_file' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:275:in `render_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:45:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ partials.rb:59:in `render_partial_without_active_scaffold' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:26:in `benchmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:26:in `benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ partials.rb:58:in `render_partial_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:55:in `render_partial' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:287:in `render_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:45:in `render' #{RAILS_ROOT}/vendor/plugins/active_scaffold/frontends/default/ views/_form.rhtml:6:in `_run_rhtml_47vendor47plugins47active_scaffold47frontends47default47views47 _form46rhtml' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/data_structures/ action_columns.rb:65:in `each' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/data_structures/ action_columns.rb:52:in `each' #{RAILS_ROOT}/vendor/plugins/active_scaffold/frontends/default/ views/_form.rhtml:2:in `_run_rhtml_47vendor47plugins47active_scaffold47frontends47default47views47 _form46rhtml' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:326:in `compile_and_render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:301:in `render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:260:in `render_file' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:275:in `render_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:45:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ partials.rb:59:in `render_partial_without_active_scaffold' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:26:in `benchmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:26:in `benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ partials.rb:58:in `render_partial_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:55:in `render_partial' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:287:in `render_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:45:in `render' #{RAILS_ROOT}/vendor/plugins/active_scaffold/frontends/default/ views/_update_form.rhtml:29:in `_run_rhtml_47vendor47plugins47active_scaffold47frontends47default47views47 _update_form46rhtml' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:326:in `compile_and_render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:301:in `render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:260:in `render_file' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ base.rb:275:in `render_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:45:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ partials.rb:59:in `render_partial_without_active_scaffold' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:26:in `benchmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:26:in `benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ partials.rb:58:in `render_partial_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_view.rb:55:in `render_partial' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/base.rb:850:in `render_partial' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/base.rb:762:in `render_with_no_layout' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/layout.rb:256:in `render_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:50:in `render_without_active_scaffold' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:50:in `render_without_active_scaffold' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_controller.rb:13:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/base.rb:786:in `render_to_string' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ deprecation.rb:43:in `silence' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/base.rb:786:in `render_to_string' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/ action_controller.rb:9:in `render' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/actions/update.rb: 22:in `edit' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/mime_responds.rb:135:in `custom' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/mime_responds.rb:167:in `respond' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/mime_responds.rb:161:in `respond' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/mime_responds.rb:105:in `respond_to' #{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/actions/update.rb: 13:in `edit' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/base.rb:1095:in `perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:632:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:638:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:438:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:637:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:634:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:638:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:438:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:637:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:638:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:438:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:637:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:634:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:638:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:438:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:637:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:638:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:438:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:637:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:638:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:438:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:637:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:638:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:449:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:637:in `call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:619:in `perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:66:in `perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/benchmarking.rb:66:in `perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/rescue.rb:83:in `perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/base.rb:430:in `process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:624:in `process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/session_management.rb:114:in `process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/base.rb:330:in `process' /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in `dispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: 78:in `process' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb: 76:in `process' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ configurator.rb:271:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ configurator.rb:270:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb: 211:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /usr/bin/mongrel_rails:18 Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ On Apr 23, 5:32 pm, "Lance Ivy" <l...@cainlevy.net> wrote: > Could you check the stack trace? That looks like a completely different
> exception. > On 4/22/07, Vorik <goo...@gerapeldoorn.nl> wrote: > > Hi again, > > This is still a problem for me, any insights (or pointers to some > > Thanks, > > On 18 apr, 07:44, Vorik <goo...@gerapeldoorn.nl> wrote: > > > Unfortunately, your example gives an error(ActionView::TemplateError > > > select_date record[:geboortedatum], :name => input_name, :order => > > > does not store the values in the database..... > > > This is the HTML source: > > > Your help is very much appreciated!! > > > Thanks, > > > On Apr 17, 6:09 pm, "Lance Ivy" <l...@cainlevy.net> wrote: > > > > we added a :name option to the date/time selects so that you can use > > > > select_date :record, :name => input_name, ... > > > > On 4/17/07, Vorik <goo...@gerapeldoorn.nl> wrote: > > > > > I'm a bit further. Now I'm using (in the helper) > > > > > select_date record[:geboortedatum], :prefix => > > > > > This makes the code for the select like this (note the name field): > > > > > Without the override in the helper (which does save the values in > > > > > My code gives the value in a hash (record_geboortedatum[day]). It > > > > > How can I achieve this little miracle??? > > > > > Greetings & Salutations, > > > > > On 17 apr, 09:30, Vorik <goo...@gerapeldoorn.nl> wrote: > > > > > > ---------------leerling_helper.rb--------------- > > > > > > The override is beiing used (order changed), but the values are > > > > > > I think it is because of the select's name. Here is an excerpt of > > > > > > Shouldn-t that be name="geboortedatum[day]"? > > > > > > how can I change it? > > > > > > Many thanks, > > > > > > > Hi Ger, > > > > > > > Your best bet here is probably to override the column on the > > > > > > > On 4/15/07, Vorik <goo...@gerapeldoorn.nl> wrote: > > > > > > > > Hi all, > > > > > > > > I'm trying to insert a record containing a birthdate with > > > > > > > > How can I set the starting year? With standard rails it is set > > > > > > > > date_select :geboortedatum, :order => > > > > > > > > The funny thing is that in 'edit mode', the years start at > > > > > > > > Thanks in advance, You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||