image_tag('batman.png' size:'100%xauto')
The size 100% x Auto is ignored as it does not follow the convention outlined in the Rails API.
Is there a way to do this in rails without the need of a global / specific css class?
size is spitted across the 'x' and on both side it finds for numbers. checkout the code You can use 'style' option for image_tag.
UPDATE:
You can use the image tag with style as followed
= image_tag 'image_url', style: 'height:100%;width:auto;'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With