I have the following models, Member and Map, configured like this:
class Member < ActiveRecord::Base ... has_one :map, :dependent => :destroy ... class Map < ActiveRecord::Base belongs_to :member
and my routes are configured with:
resources :members do resources :maps end
and my card controller:
def new @map = Map.new end def create @map = current_member.map.new(params[:map]) if @map.save.....
But when I try to save a new map, I get an undefined method 'new'
error message on this line. I'm not sure why.
source share