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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:15:33+00:00 2026-05-28T20:15:33+00:00

Study -> has_many Topics -> has_many References My Model has the following method to

  • 0

Study -> has_many Topics -> has_many References

My Model has the following method to access references based on topic ID:

  def self.rel_references(topic_id)
    Reference.where(:topic_id => topic_id)
  end

I am accessing the above in my controller as follows:

@references= Study.rel_references(params[:topic_id])

I need to have a form on the Study model’s Show page to access the references based on the topics the user clicks. (A remote form that loads references based on the topic_id). The way I am trying to do this is:

  - form_tag rel_references, :id=>"references_form", :method => 'get' do               
    = text_field_tag :topic_id, params[:topic_id]
    = submit_tag "Get references"

However, I am not being able to access the references in my view. Please help me understand what I may be doing wrong here. I am very new to Rails so I might be missing something here. Thanks!

  • 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-28T20:15:34+00:00Added an answer on May 28, 2026 at 8:15 pm

    Removing the deprecated Style block helper – and replacing it with = in my form solved this problem for me. My form Now looks like:

    = form_tag rel_references, :id=>"references_form", :method => 'get' do               
      = text_field_tag :topic_id, params[:topic_id]
      = submit_tag "Get references"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone seen a recent (and fairly balanced) study into the relative costs for
Pascal is my study language and I am curious whether C# also has the
I have the following line in a php file: $labels['study'] = 'Study'; Then, I
I have the following models: class Keyword < ActiveRecord::Base has_many :tags has_many :studies, :through
I like to study languages outside my comfort zone, but I've had a hard
I'm making a study on refactoring limitations on improving existing software architecture and I
The situation When you study social sciences, you are frequently confronted with the need
In my independent study of various compiler books and web sites, I am learning
I want to study Cocos2d, seems it's a good framework for iPhone game programming.
This is a study project. I have three database classes A,B,C. There is a

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.