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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:50:31+00:00 2026-05-25T15:50:31+00:00

In my application everything works fine, but in my Active Admin backend I don’t

  • 0

In my application everything works fine, but in my Active Admin backend I don’t get my user roles displayed on screen.

I have two models “User” and “Roles”:

class Role < ActiveRecord::Base
  has_and_belongs_to_many :users, :join_table => :roles_users
end

class User < ActiveRecord::Base
  has_and_belongs_to_many :roles, :join_table => :roles_users
end

I get it to work in the rails console:

ruby-1.9.2-p290 :006 > user.roles
 => [#<Role id: 3, name: "Student">, #<Role id: 2, name: "Supervisor">] 
ruby-1.9.2-p290 :007 > user.roles[0].name
 => "Student" 
ruby-1.9.2-p290 :008 > user.roles[1].name
 => "Supervisor" 

And I tried several ways of implementing this in Active Admin DSL (one of it):

ActiveAdmin.register User do
  index do
    column :email
    column "Role" do |user|
      user.roles.each do |p|
        p.name
      end
    end
  end
end

Could somebody please help me?
How do I get it to work in DSL of Active Admin?

  • 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-25T15:50:32+00:00Added an answer on May 25, 2026 at 3:50 pm

    I haven’t tested this myself, but I believe you need to return a string from the block in “column”, so something like

    column "Role" do |user|
      user.roles.map({ |p| p.name }).join(' ')
    end
    

    might work.

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

Sidebar

Related Questions

I'm developing Swing application, and everything works fine usually. But I have an GUI
there's an audio application which streams files via network, everything works fine but one
I am working on a Poker-iPhone-Application. Everything works just fine but I would like
I have made an mvc3 application with Windows Authentication. Everything works fine but I
I built an application in c# vs2005 .net . Everything works fine when i
I'm publishing a feed from a Django application. I subclassed django.contrib.syndication.feeds.Feed, everything works fine,
I have an application that calls a number stored by the user. Everything works
I am doing a Jndi look up using <jee:jndi-lookup> . Everything works fine but
I have an Intranet application with Windows Authentication. Everything works fine. However, for some
I use dynatree and everything works fine but if a node has large number

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.