Reputation: 3196
Trying to create a custom input element using Formtastic. Started from something really simple:
app/input/card_body_input.rb
:
class CardBodyInput < FormTastic::Inputs::Base
include Base
def input_html_options
{
:cols => builder.default_text_area_width,
:rows => builder.default_text_area_height
}.merge(super)
end
def to_html
input_wrapping do
label_html <<
builder.text_area(method, input_html_options)
end
end
end
and I try to use it like this:
f.inputs do
f.input :back_content as: :card_body
end
To which I get Unable to find input class for card_body
.
Any ideas? Thank you.
Upvotes: 1
Views: 1501