mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Bring custom form_builder initializer from spree_backend
This commit is contained in:
15
config/initializers/form_builder.rb
Normal file
15
config/initializers/form_builder.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Allow some application_helper methods to be used in the scoped form_for manner
|
||||
#
|
||||
class ActionView::Helpers::FormBuilder
|
||||
def field_container(method, options = {}, &block)
|
||||
@template.field_container(@object_name,method,options,&block)
|
||||
end
|
||||
|
||||
def error_message_on(method, options = {})
|
||||
@template.error_message_on(@object_name, method, objectify_options(options))
|
||||
end
|
||||
end
|
||||
|
||||
ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "<span class=\"field_with_errors\">#{html_tag}</span>".html_safe }
|
||||
|
||||
Reference in New Issue
Block a user