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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:45:10+00:00 2026-05-25T12:45:10+00:00

So, I found this: Searchlogic OR condition results in undefined method But that only

  • 0

So, I found this: Searchlogic OR condition results in undefined method

But that only works for fields on the model your are searching on directly.
I have a suscription model, but I want to search over the different subscriptions’ account names OR their other_field, for example.

from the above link (and modified) I’d like to be able to do something similar to this:

  named_scope :account_name_full_domain_like, lambda{ |name|{
     :conditions => ["accounts.name LIKE ? OR accounts.full_domain LIKE ?", "%" + name + "%", "%" + name + "%"],
     :joins => "LEFT JOIN `accounts` ON `accounts`.id = `subscriptions`.account_id"
    }}

but now I get an error on this:

27:     <% form_for @search do |f| %>  

undefined method `subscription_subscription_path' for #<ActionView::Base:0x11061dbc0>

EDIT:
figured it out:
had to include .search in my call for assignment of the @search var

@search = Subscription.search.account_name_full_domain_like(term)
  • 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-25T12:45:10+00:00Added an answer on May 25, 2026 at 12:45 pm

    Provided your named scope is on your Subscription model, you will be returning subscription records. Your condition and join seem to be valid. I am not sure what the relationship of this named scope is to the instance variable @search you seem to be using in your view.

    Is the path ‘subscription_subscription_path‘ where you were expecting to submit this form to? If so, run “rake routes”, and ensure that you have a path named ‘subscription_subscription_path’.

    If you want to submit to an alternate path, you can specify the url to submit to in form_for by doing something like the following:

    <% form_for @search, :url => subscription_path(@search) %>
    

    More information on specifying a URL for form_for can be found here: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for

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

Sidebar

Related Questions

Found this method of having DIV as custom google maps infoWindow. It works, but
Found this code that breaks out CSV fields if contains double-quotes But I don't
I found this tutorial that explains what I want to do using html but
I found this answer, but it is far from a simple code snippet that
Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
I found this open-source library that I want to use in my Java application.
I found this link http://artis.imag.fr/~Xavier.Decoret/resources/glsl-mode/ , but there isn't a lot of description around
I found this in an article on Multithreaded Apartments, but can’t find a definition
I found this PECL package called threads , but there is not a release
I found this code for a replacement gotoxy() function using C standard library only.

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.