I’m working on my first Rails app. It’s a redesign for a magazine
site. I have a class for the articles and a class for issues. I’ve
set up a has_many/belongs_to relationship between the two so that
every article belongs to a particular issue.
Now I’d like to set it up so that a new article cannot be added UNLESS
you have already chosen the issue that it is to be added to. I’d like
to set something up like
“selected_issue.articles.build(params[:article])” but I don’t know how
to create an action/method that would allow me to set the
selected_issue variable and then pass that into the create method on
the article controller.
Could someone lend some assistance here?