Method: Formtastic::Inputs::Base::Html#to_html

Defined in:
lib/formtastic/inputs/base/html.rb

#to_htmlObject

This method is abstract.

Implement this method in your input class to describe how the input should render itself.

Defines how the instance of an input should be rendered to a HTML string.

Examples:

A basic label and text field input inside a standard wrapping might look like this:

def to_html
  input_wrapping do
    label_html <<
    builder.text_field(method, input_html_options)
  end
end

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/formtastic/inputs/base/html.rb', line 17

def to_html
  raise NotImplementedError
end