Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9055369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:56:19+00:00 2026-06-16T13:56:19+00:00

trying to make link to my recent uploaded image <%= link_to (image_tag (post.image_url(:thumb))), post.image.url(:original),

  • 0

trying to make link to my recent uploaded image

<%= link_to (image_tag (post.image_url(:thumb))), post.image.url(:original), :class => 'postimage' %>

how ever it’s not working, at all…

   <% @post.image do |image| %>

   <%= link_to (image_tag (post.image_url(:thumb))), post.image.url(:original), :class        => 'postimage' %>

 <% end %>

the fun part is that

<%=  @post.image %>

works. but only shows /uploads/post/image/3/eKoh3.jpg

full code here https://gist.github.com/4332533

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:56:20+00:00Added an answer on June 16, 2026 at 1:56 pm

    This line looks wrong to me:

    <% @post.image do |image| %>
    

    (btw your gist actually says @post.image.each do |image|, which I’m assuming is what you meant to do above)

    If you are mounting an uploader on your Post model’s :image attribute, then this makes no sense. A mounted uploader allows you to upload one image, and you can’t iterate over it using each.

    I’m not sure what you’re trying to do. Are you trying to iterate over all the versions? Try post.image.versions.each

    Are you trying to upload multiple images? Carrierwave can’t help you with that directly. You’ll need to create a new model, Image, and mount your uploader there. Your Post will need a line like

    has_many :images
    

    And your Image model will need to belong_to :post. You’ll also need to figure out how to upload and manage images in that new table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make link_to function have a css class attached to it, My
Im trying to make my img link to this same image. Unfortunately it is
I'm trying to make a link that will perform an ajax post request... the
I'm trying to make a pseudo link class with the CSS3 text-shadow for both
I am trying to make Link Web / link info directory in C# where
I'm trying to make my tumblr posts link directly to the source when clicked
I'm trying to make this be a link to a destroy action for a
I am trying to make a row in a table link to the edit
Possible Duplicate: CakePHP: image inside link, want to make link point to image location
I am trying to make a jquery tool tip to open up a link

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.