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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:08:40+00:00 2026-05-26T15:08:40+00:00

I currently have a Rails 3.0.10 app and I made two models with simple

  • 0

I currently have a Rails 3.0.10 app and I made two models with simple associations: has_many, and belongs_to.

After installing the ActiveAdmin plugin and creating the corresponding Ruby resource files, I’ve noticed some strange behavior.

Below, you can see that “Job File” belongs_to “Ernet Clients”. The associations are all working correctly, however, the display name is appearing as the actual ActiveRecord object instead of the client name.

enter image description here

This is the show view when under the “Job File” section:

enter image description here

But, if I go to view the actual client, the correct text appears:

enter image description here

There must be something going wrong in the “Job File” resource that is causing this, but I can’t figure out what it could be. After googling I found this: http://groups.google.com/group/activeadmin/browse_thread/thread/2a261e070efa7bae

Within the JobFile.register file I specified the display name with this:

filter :ernet_client, :display_name_methods => :display_name

This didn’t work, though, and I cycled through all of the other available names to no avail.

I looked up ActiveAdmin’s dependencies and sass-rails seems to be the only one – but that is if you are using 3.1 and I’m using Rails 3.0.10.

And finally, to be sure that my associations were indeed working, I opened up the Rails console and created a job file:

job = JobFile.new
=> #<JobFile hash returned>
job.ernet_client_id = 2
=> 2
job.ernet_client.client_name
=> Target

Everything seems to be working as it should.

Anyone have any insight on to how to solve this?

  • 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-26T15:08:40+00:00Added an answer on May 26, 2026 at 3:08 pm

    Did you try defining a to_s method on the ErnetClient model?

    def to_s
      display_name
    end
    

    It looks like this is the method that is being called automatically, as if you did call to_s on one of these objects in the console you would get a similar result.

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

Sidebar

Related Questions

I'm currently writing a Rails app, and hit a somewhat strange quirk. I have
In the Rails application I’m currently developing I have many request models. We are
I currently have a f.collection_select in my rails app. What is the best way
I'm currently developing a Rails app with 4 nested models (as per THIS POST
I currently have a Rails 3.1 app that hosts multiple sites for several different
I have a simple work schedule rails app. The jobs in the schedule will
Currently I have a Rails 3 app that subscribes new users up to MailChimp.
I have a Rails app (v2.3.8) using HAML (v3.0.25). My application.html.haml currently has the
I currently have a Rails app in which users of different ranks can upload
I have a private Rails app that I'm trying to install locally. It's currently

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.