check_box ヘルパーでエラーが発生し、何が間違っているのかわかりません:
undefined method `prive' for #<PubContributeur:0xa63b8fc>
これは私のapp/models/pub_contributeur.rb です:
class PubContributeur < ActiveRecord::Base
attr_accessible :nom, :prive
validates :nom, :presence => true
validates :nom, :length => { :in => 2..30 }, :uniqueness => { :case_sensitive => false }
end
コントローラーで名前空間カタログを使用しています。これは、ビューapp/views/catalogs/pub_contributeurs/ _form.html.haml のような私の HAMLです。
= form_for [:catalogs, @pub_contributeur], :html => {:class => "formulaire-standard"} do |f|
= render :partial => 'shared/error_message', :locals => { :element => @pub_contributeur, :debut_erreur => 'Ce contributeur ne peut être enregistré'}
.groupe-champs
.champ
= f.label :nom
= f.text_field :nom, :class => 'input-width-8-col', :required => 'required'
.champ
= f.label :prive
= f.check_box :prive
何か案が ?