How to style an image tag in Ruby on Rails

by using "style" option:

<%= image_tag @user.photo.url(:large), :style => "border: 1px solid red" %>

for further info, please check the API.


Add a class or id to your image_tag:

<%= image_tag @user.photo.url(:large), :class => "style_image" %>

Then use css to style it:

.style_image {
  border-right: 1px solid #000;
}