0
문제가 있습니다, 지역을 선택할 수 없습니다. 세 가지 모델이 있습니다. spot => city, city => region. 모델 스포트에서는 필드 영역을 havent합니다.간단한 형태로 선택
class Spot < ActiveRecord::Base
belongs_to :city
end
class City < ActiveRecord::Base
belongs_to :region
end
class Region < ActiveRecord::Base
end
= simple_form_for(@spot, :url => admin_spot_index_path) do |f|
= f.error_notification
= f.association :city, :collection => City.all, label: false
#TODO
Select region ??
단순한 형태로 선택 영역을 나타내는 방법은 무엇입니까?
감사합니다. 이것은 필요하지 않습니다 =) 모델 지점에서 지역 모델과 연결되지 않았으므로 오류가 발생합니다. # –
vadus
에 대해 정의되지 않은 메서드 인 'region'은 spot 필드에 region_id를 저장하려고합니다. 또는 무엇을? –