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 6884573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:31:35+00:00 2026-05-27T05:31:35+00:00

I need to display multiple images for a a car from a separate linked

  • 0

I need to display multiple images for a a car from a separate linked table, i have the both models sorted with the belongs_to and has_many but on the main car page i need to show images from the linked table that have the same id.

here is the current code:-

<p id="notice"><%= notice %></p>


<h2>
  <em><%= @car.make.make_name %> <%= @car.model %> <%= @car.body_typw %> <%= @car.engine_size %> <%= @car.trim %></em>
</h2>

<p>
  <%= image_tag @car.image(:large) %>
</p>

<% @carimages.each do |carimage| %>

    <%= image_tag carimage.image(:thumb), :class => "imgsmall" %>

<% end %>

<p>
  <b>Transmission:</b>
  <%= @car.transmission %>
</p>

<p>
  <b>Fuel type:</b>
  <%= @car.fuel_type %>
</p>

<p>
  <b>Millage:</b>
  <%= @car.millage %>
</p>

<p>
  <b>Price:</b>
  <%= number_to_currency(@car.price) %>
</p>

<p>
  <%= raw @car.content %>
</p>

<p style="font-size:16px;"><b>Call us now on <span style="color:red;">01446 746 785</span> to find out more about the <%= @car.model %> <%= @car.body_typw %> <%= @car.engine_size %> <%= @car.trim %></b></p>

so basically the url is – http://localhost:3000/cars/1 and i want the car images with the linked id of car_id of 1 to be shown.

Robbie

  • 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-05-27T05:31:35+00:00Added an answer on May 27, 2026 at 5:31 am

    This does the trick:

    <% @car.carimages.each do |carimage| %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project in which I need to display multiple UITableView instances inside
I need to display a list of dates, which I have in a table
I need some help finding a jQuery solution to display multiple images in a
I need a program that reads from multiple files and displays a report based
I need to display content from an OLAP cube in Sharepoint. This could be
I need to display a real time data from MS SQL 2005. I saw
i need to display images and play corresponding audio files one after the other.
I have a div container where I am displaying multiple images and now I
I need to display some images which can be scrolled horizontally. Only one image
I am implementing a display algorithm where we can have multiple layers of windows

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.