How to query with has_may belongs_to associations in controller for Rails Activerecord

0 votes
asked Mar 15, 2016 by improved (1,130 points)
I am really confused on how has_many and belongs_to works within controller, more specifically how to query data.

4 Answers

0 votes
answered Apr 10, 2016 by any_cases (1,010 points)
selected Apr 11, 2016 by lbh_a
Best answer
This is useful when you want to have a global variable
Interesting example here hirocaster/activerecord-sharding GitHub it exactly what you need
0 votes
answered Mar 26, 2016 by Just_1979 (350 points)

This can beany other type of association, including other : throughassociations.
0 votes
answered Apr 29, 2016 by Ennen (140 points)
This is a simple question with a very complicated answer. Assuming you got it from Update Many-to-Many Association with GraphDiff just unzip it wherever you want
0 votes
answered May 25, 2016 by kresse (180 points)
I just found this same problem. I had this myself a while back

What is Geekub?

Q&A site for professional and enthusiast programmers, software developers and other technical users. With your help, we hope to work together to build a library of detailed answers to just about any question that is related to programming!