I have an organisation model and I have also made a series of nested models under the folder name "stance". One of those models is called overview.
The associations are:
namespace :stance do
<p><%= @overview.internal_explanation %></p>
<p><%= @stance.overview.internal_explanation %></p>
<p><%= @stance::overview.internal_explanation %></p>
o = Stance::Overview.create(internal_explanation: "test")
If you don't use the standard naming convention, then you need to give Rails some hints:
has_one :overview, class_name: Stance::Overview belongs_to :organisation, inverse_of: :overview
Best place to learn this is to look at the source code comments on
belongs_to. I'd recommend using an editor that has a "go to source"/"go to declaration" functionality that allows you to CTRL-click a method name and jump into the gem code so you can see the comments. I used this via Rubymine when I was learning Ruby and it was an enormous help.