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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

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

ios - I get the error Property '...' not found on object of type '...' -