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

  • Home
  • SEARCH
  • 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 985777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:12:56+00:00 2026-05-16T05:12:56+00:00

I am trying to display this object in my view — – !ruby/object:Customer attributes:

  • 0

I am trying to display this object in my view

--- 
- !ruby/object:Customer 
    attributes: 
     country: United Kingdom
     last_name: a
     first_name: b
    attributes_cache: {}

    histories: 
    - !ruby/object:History 
      attributes: 
       start_date: 11/03/2010
       finish_date: 
      attributes_cache: {}

I thought you would access start_date by doing

 <% @customers.each do |customer| %>
   <%= customer.histories.start_date %>
 <% end %>

but I get

undefined method `start_date'

This is the find i used

 @customers = Customer.find(:all, 
    :conditions =>['customers.id IN (?)', intersection], 
    :include => :histories
  )

whats am I doing wrong ?

Thanks

  • 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-16T05:12:57+00:00Added an answer on May 16, 2026 at 5:12 am

    customer.histories is an array of History objects, so you want something like this:

    <% @customers.each do |customer| %>
      <%= customer.histories.first.start_date %>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 499k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Update Thanks to a 3rd party plugin, SlowCheetah, this is… May 16, 2026 at 12:32 pm
  • Editorial Team
    Editorial Team added an answer Nowadays links can be found starting from here. This usually,… May 16, 2026 at 12:32 pm
  • Editorial Team
    Editorial Team added an answer int x = 3; class { public: int &value; }… May 16, 2026 at 12:32 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to display an object in the view which can be rotated naturally
I'm trying to display a form on a template, but I get a fantastic
I am trying to get my tree view to group a collection of similar
I'm trying to display a UIImage in real-time coming from the camera, and it
Made solution change: I am trying to display a html table of data.. In
I am trying to measure an object immediately after changing the DataContext, but the
I am trying to display filenames in a listbox, retrieved from a particular directory.
I am trying to display my command objects collection field inside a list box.
I'm using MVVM (MVVM Light Toolkit) and have a property on the view model
I know this is a silly doubt but I just want to make sure

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.