Alex
Alex

Reputation: 2780

partial with image tag in Rails

I am having difficulty sending image info to a partial while using content_for.

Here is my code:

home.html.erb
<% content_for :imageName do %>
  <%= image_tag "profile_alexpic.jpg",
      :class => "img-circle pull-xs-left",
      :width => "100",
      :height => "100" %>
<% end %>

<%= render 'layouts/jumbo' %>
_jumbo.html.erb
<%= content_for(:imageName) %>

Everything is rendering exactly how I want it, but the text profile_alexpic.jpg is output next to the image. How do I prevent this?

Upvotes: 0

Views: 345

Answers (0)

Related Questions