logo
Tags down

shadow

How to output Rails image_tag with Vue class binding


By : tkfever
Date : October 14 2020, 02:22 PM
wish of those help How do I output an image tag which has a bound class from Rails for use by Vue? , I think it's this
code :
<%= image_tag "triangle.png", "v-bind:class": "{'asc': !sort_by_desc, 'desc': sort_by_desc}" %>


Share : facebook icon twitter icon

How to add class to an image_tag rails helper


By : user3814186
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Your class has to be assigned inside of the brackets to be used as part of the options being passed through. Try:
code :
<%= image_tag(iterator.image.url(:small), :class => "img_preview") %>

Rails 3: Create new rails asset helper like image_tag that points to s3


By : Rémi Parent
Date : March 29 2020, 07:55 AM
hop of those help? I just ended up writing new helpers in application_helper.rb that mimicked the default asset helpers like so:
code :
def s3_image_path(filename)
  "http://site.s3.amazonaws.com/assets/#{filename}"
end

def s3_image_tag(filename, options={})
  image_tag(s3_image_path(filename), options)
end

Image_tag in rails


By : Doug W
Date : March 29 2020, 07:55 AM
Any of those help I'm assuming you are using erb, if so you need to be using the erb scriptlet tags <%= ... %>
Example:
code :
<%= image_tag("SAVEonSHIRTS_website_homepage_01.png") %>

Adding specific class to image_tag within link_to in rails


By : ALE Nicolau
Date : March 29 2020, 07:55 AM

Using multiple class in image_tag helper in ruby on rails


By : Saba Masih
Date : March 29 2020, 07:55 AM
I hope this helps . How do I pass multiple classes to the image_tag helper in a Rails 5 app? I want to convert this HTML tag: , Although your img in the example isn't a valid one, you can try with:
code :
<% if @post.picture %> # To check if @post.picture isn't nil
  <%= image_tag @post.picture.url, class: 'etalage_thumb_image img-responsive' %>
<% end %>
shadow
Privacy Policy - Terms - Contact Us © voile276.org