Allow the component to render itself

This commit is contained in:
Rafael Mendonça França 2014-03-10 18:13:37 -03:00
parent 7a167ca65b
commit fa061b6a80
1 changed files with 5 additions and 1 deletions

View File

@ -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