Search code examples
ruby-on-railsfilepicker.io

Rails - adding a class to filepicker_image_tag with filepicker-rails Gem


Using:

gem 'filepicker-rails'

I can't seem to add a class like this:

<%= filepicker_image_tag @user.photo_url, w: 32, h: 32, fit: 'clip', class: 'my_class' %>

This seems like it should be easy.

Am I doing this incorrectly, or is it not possible?


Solution

  • It is possible.

    I just had to curly-bracket the filepicker options, and then assign the class like this:

    <%= filepicker_image_tag @user.photo_url, { w: 32, h: 32, fit: 'clip'}, class: 'my_class' %>