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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:01:39+00:00 2026-06-11T18:01:39+00:00

Active Admin Dashboard ActiveAdmin.register_page Dashboard do menu :priority => 1, :label => proc{ I18n.t(active_admin.dashboard)

  • 0

Active Admin Dashboard

  ActiveAdmin.register_page "Dashboard" do

  menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }

  content :title => proc{ I18n.t("active_admin.dashboard") } do

    section h2 "Top Movie" do

            table_for @top_ps.where('ptype = ?', 'movie') do |t|

               column("Title"){|p| link_to p.title, admin_program_path(p.id)}

               column "Start" do |p|

                    p.program_schedules.each do |schedule|

                            link_to distance_of_time_in_words(Time.now, schedule.start,true), admin_program_schedule_path(schedule.id)
                    end

                end


            end
        end

  end # content
end

If I run this i get

[#<ProgramSchedule id: 746, program_id: 430, start: "2012-09-17 09:30:00", stop: "2012-09-17 10:30:00">, 
#<ProgramSchedule id: 8124, program_id: 430, start: "2012-09-22 23:30:00", stop: "2012-09-23 00:30:00">]

Instead of

<a href="/path">Start</a>
<a href="/path">Start</a>

I understand where I am wrong, but how to execute that code inside a block?

  • 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-11T18:01:41+00:00Added an answer on June 11, 2026 at 6:01 pm

    This template DSL is called Arbre. I’m not sure if it’s used much outside of ActiveAdmin. With the release of ActiveAdmin 0.5.0 it’s been split off into it’s own gem https://github.com/gregbell/arbre

    If you don’t want to deal with it you can render a partial. So in your dashboard code put something like

    section h2, "Top Movie" do
      div do
        render :partial => "admin/dashboard/top_movie"
      end
    end
    

    And then

    # /views/admin/dashboard/_top_movie.html.erb
    
    <div style="width:300px;">
      Normal arbitrary view code. <%=some_ruby%>
    </div> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I translated my active admin menu : # encoding: utf-8 ActiveAdmin.register City do menu
I'm trying to include a section containing a partial in my Dashboard on ActiveAdmin.
the active admin docs says: If you are using Rails >= 3.1, you must
I had a working Active Admin app working on my local server, but after
I'm using Devise and Active Admin, and so far there are playing nice together.
Attempting/struggling to get registration and sign-up working within an active admin project. I have
I am using Rails 3.1.3 with active admin gem. I am trying overwrite the
Active admin wrote the wrong path for my resource. I don't know how to
I am designing a basic file manager (the Asset model) in the Active Admin
I'm trying to add ordering/re-ordering to a resource in Active Admin. I understand that

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.