Ben2pop
Ben2pop

Reputation: 756

Ruby on rails Paper clip and ImageMagick issue

Hello guys could you please help me ?? ;-)

I am following the skilshare class of Mattan Griefeld on ruby on rails . After two days of searching and debugging I still have the same error using paperclip and ImageMagick. In fact I think I successfully installed ImageMagick and tested it using :

$ convert logo: logo.gif
$ identify logo.gif
$ display logo.gif

The Paperclip gem was successfully installed using bundle install but still the image does not want to show up, I do not know what to do. The Show page puts /system/pins/images/000/000/006/original/el1.jpg?1377544319 instead of my image.

Here is my code:

 <div class="row"> 
    <div class="span6 offset3">
        <div class="well">
            <p><%= @pin.image %></p> 
            <p><%= @pin.description %></p><br>
            <p><%= @pin.user.name %></p>

<% if current_user == @pin.user %>
  <%= link_to 'Edit', edit_pin_path(@pin) %> 
<% end %>
  <%= link_to 'Back', pins_path %>
        </div>
     </div>
</div>

The controller behind @pin is :

def show
 @pin = Pin.find(params[:id])
 respond_to do |format|
 format.html # show.html.erb
 format.json { render json: @pin }
 end
end

Could you please help me to solve that issue ?

Upvotes: 1

Views: 182

Answers (1)

TomDunning
TomDunning

Reputation: 4877

image_tag @pin.image.path

@pin.image is just the image info. you still need image_tag

Upvotes: 1

Related Questions