Allow the component to render itself
This commit is contained in:
parent
7a167ca65b
commit
fa061b6a80
|
@ -9,13 +9,17 @@ module SimpleForm
|
|||
def render(input)
|
||||
options = input.options
|
||||
if options[namespace] != false
|
||||
content = input.send(namespace)
|
||||
content = component.render(input)
|
||||
wrap(input, options, content) if content
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def component
|
||||
components.first
|
||||
end
|
||||
|
||||
def html_options(options)
|
||||
[:label, :input].include?(namespace) ? {} : super
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue