remove the method from your helper class. when you say config.columns[:state].form_ui = :usa_state, active scaffold will automatically make the column a USA state select box.
If you still need to override this then in your helper you would need to do something like this def state_form_column(record, input) usa_state_select :record, :state end but it doesn't seem that you are trying to add any options so just delete the helper method. ~Kenny On Thu, May 14, 2009 at 9:40 AM, JannaB <[email protected]> wrote: > > Thank you Kenny, Yes, I try that, yet I still get essentially the same > stack trace of: > << > ActionView::TemplateError (undefined method `usa_state' for > #<ActionView::Base:0x467853c>) on line #7 of vendor/plugins/ > active_scaffold/frontends/default/views/_form_attribute.html.erb: > 4: <label for="<%= active_scaffold_input_options(column, scope) > [:id] %>"><%= column.label %></label> > 5: </dt> > 6: <dd> > 7: <%= active_scaffold_input_for column, scope %> > 8: <% if column.description -%> > 9: <span class="description"><%= column.description %></span> > 10: <% end -%> > > app/helpers/associate_helper.rb:29:in `state_form_column' > vendor/plugins/active_scaffold/frontends/default/views/ > _form_attribute.html.erb:7 > vendor/plugins/active_scaffold/frontends/default/views/ > _form.html.erb:14 > vendor/plugins/active_scaffold/frontends/default/views/ > _form.html.erb:2 > vendor/plugins/active_scaffold/frontends/default/views/ > _update_form.html.erb:42 > >> > > in my helper class, I have: > > def state_form_column(record, input_name) > usa_state :record, :state, :name => input_name > end > > and in my controller: > > active_scaffold :associate do |config| > ... > config.columns[:state].form_ui = :usa_state > end > > I must be really missing something stupid here, no? -Janna B. > > On May 14, 10:30 am, Kenny Ortmann <[email protected]> wrote: > > usa_state not use_state > > > > On Thu, May 14, 2009 at 8:18 AM, JannaB <[email protected]> > wrote: > > > > > Somewhere in the docs I encountered: > > > << > > > In addition to the :checkbox option, ActiveScaffold supports these > > > other options: :calendar, :country, :password, :textarea, > > > and :use_state. > > > > > I've been trying to get use_state to work. My logs come back as: > > > > > << > > > ActionView::TemplateError (undefined method `use_state' for > > > #<ActionView::Base:0x482ac2c>) on line #7 of vendor/plugins/ > > > active_scaffold/frontends/default/views/_form_attribute.html.erb: > > > 4: <label for="<%= active_scaffold_input_options(column, scope) > > > [:id] %>"><%= column.label %></label> > > > 5: </dt> > > > 6: <dd> > > > 7: <%= active_scaffold_input_for column, scope %> > > > 8: <% if column.description -%> > > > 9: <span class="description"><%= column.description %></span> > > > 10: <% end -%> > > > > > app/helpers/associate_helper.rb:30:in `state_form_column' > > > vendor/plugins/active_scaffold/frontends/default/views/ > > > _form_attribute.html.erb:7 > > > vendor/plugins/active_scaffold/frontends/default/views/ > > > _form.html.erb:14 > > > vendor/plugins/active_scaffold/frontends/default/views/ > > > _form.html.erb:2 > > > vendor/plugins/active_scaffold/frontends/default/views/ > > > _update_form.html.erb:42 > > > > > So I scoured the sources for AS, looking for the string "use_state," > > > and found nothing. Is use_state really supported? Does anyone have an > > > example wherein they show using use_state (and perhaps country too?). > > > I am able to get the others to work, but am stumped here and I am > > > wondering if it is even supported, and if it is, does anyone have an > > > example of it? Thanks so much, Janna B. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
