JannaB wrote ...
> I have in customers_helper.rb:
>
> def custom3_form_column(record, input_name)
> text_field :record, :custom3, form_element_input_options
> (input_name, Customer,
> # Adjust options as necessary
> { :class => 'text-input', :size => 60 })
> end
>
> and I'm getting an error here I don;t understand:
>
> ActionView::TemplateError (undefined method
> `form_element_input_options' for #<ActionView::Base:0x65847f0>) on
> line #7 of vendor/plugins/active_scaffold/frontends/default/views/
> _form_attribute.html.erb:
Sorry about that. I didn't dig deep enough into my particular code and
mistakenly thought it had no other dependencies. Not so.
It turns out that form_element_input_options is an application-specific
method (in ApplicationHelper):
def form_element_input_options(column_name, scope_class, options = {})
if column_name.is_a?(String) || column_name.is_a?(Symbol)
# Called from a helper override
input_name = column_name.to_s
klass = scope_class
raise ArgumentException, "'#{input_name}' is invalid" unless input_name
=~ /record([^\[]*)\[([^\]]*)\]/
scope, name = $1, $2
scope = nil if scope.blank?
column = ActiveScaffold::DataStructures::Column.new(name, klass)
active_scaffold_input_options(column, scope).merge(options)
elsif column_name.is_a?(ActiveScaffold::DataStructures::Column)
# Called from a partial overrride
column = column_name
scope = scope_class
active_scaffold_input_options(column, scope).merge(options)
elsif
raise ArgumentException, "Unknown argument type:
#{column_name.class.to_s}"
end
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---