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

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -