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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:13:41+00:00 2026-05-19T04:13:41+00:00

when during a bigger site, i wan’t to make a dashboard, and on the

  • 0

when during a bigger site, i wan’t to make a dashboard, and on the dashborad i want some kind of “events” or “activity”.. so i’d figured this out

# Controller
replies = current_user.replies.order('updated_at desc')
topics = current_user.topics.order('updated_at desc')

@events = (replies + topics)

 

# View
  - for event in @events
    %div.forum-row
      %div.date
        = link_to "Link", event  
        = time_ago_in_words(event.updated_at)
        =t :home_ago
      %div.by
        = t(:home_by, :href => link_to(event.user.username, "#")).html_safe

      %div.clear
        = " ".html_safe

      %div.clear

And that’s work fantastic, but i want to at first make a bold line where it says what type it is.. like

“Posted a Topic: You posted a Topic 4 minutes ago”

or something like that.. But i can’t see how to do that when i’m merging them together in the on @events..

  • 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-19T04:13:42+00:00Added an answer on May 19, 2026 at 4:13 am

    You can use the object class name to output the type of event:

    "Posted a #{event.class.name}: You posted a #{event.class.name} 4 minutes ago"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

During the installation of my app, I want to create a PostgreSQL-Database and some
During some of the page transitions (for example during the turn and flow transitions)
During our build process, we run sqlldr to populate our database with some sample
During my research I have found opinions pointing in both directions on this issue.
during build with Visual Studio C++ I get this error: error C2027: use of
During my day-to-day work, I tend to come across data that I want to
During development, i can easily manage my users/roles/smtp etc using the Administer Web Site
During an ordeal yesterday, I learned that you can't pass this query to EXEC():
Apologies if this kind of thing has been answered elsewhere. I am using Python
During loading of my android application i want to show a logo during the

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.