ruby on rails - custom inputs of simple form for images -
in form, let user upload file (image), looks this:
= simple_form_for [:admin, @team] |f| = f.input :logo, as: :photo = image_tag @team.logo.url if @team.logo? = f.hidden_field :logo_cache
and want create custom input photos, should include hidden field , displaying image.
class photoinput < simpleform::inputs::base def input @builder.file_field(attribute_name, input_html_options).html_safe end end
this basics, have problems input, because doesnt seem know methods image_tag or link_to...
Comments
Post a Comment