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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:10:29+00:00 2026-05-15T01:10:29+00:00

So in another controller, I use a find like this: @entries = Entry.find(:all, :conditions

  • 0

So in another controller, I use a find like this:

@entries = Entry.find(:all, :conditions => ['live = ?', false])

to find all the entries with a false ‘live’ column.

In my project I’m using two different taggable types, one for entries (Entry), and one for messages (Message). After looking at my tried and true code above you would think that I could do something similar to find all the tagged messages with the “Message” value in the taggable_type column of the taggings table.

#this could help find only Messages with the taggable_type column value "Message"
@tagged_messages = Message.find(:all, :conditions => ['taggable_type = Message', true])

The problem here is that my find condition addresses the Message model [Message.find(…] Which won’t work because [from my understanding] the taggings table doesn’t have an associated model. I’m probably wrong. So how do I search a table that’s not associated with a model? I’m probably completely missing something here. I would greatly appreciate any help or code that would help me understand this or help get this working. Thanks for reading my question.

  • 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-15T01:10:30+00:00Added an answer on May 15, 2026 at 1:10 am

    @tagged_messages = Tagging.find_all_by_taggable_type('Message').map(&:taggable) should do what you want. You might need to throw a uniq in there somewhere as well.

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

Sidebar

Related Questions

I have a controller action which I would like to call another controller action.
I'd like to be able to dispatch from one controller action to another conditionally,
Another easy one hopefully. Let's say I have a collection like this: List<DateTime> allDates;
I want to have my API controller use SSL, so I added another listen
Is it possible to do something like this in an ASP.NET MVC controller? public
I have a controller that contains a tableView that spawns another controller modally to
CakePHP Newbie :) I am having trouble accessing another controller and passing that data
I'm having trouble navigating to a different controller view from another controller action. e.g.
Is it possible to display a view from another controller? Say for example I
ASP.Net MVC Controllers have several methods of forwarding control to another controller or action.

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.