Closed JulienItard closed 11 years ago
Which version are you using? Did you restart your server after updating your initializer? What does the rest of the form look like?
Edit : I use gem 'contact_us'
instead of gem 'contact_us', '~> 0.4.0'
now it's work. :)
I use the latest verion of your gem, ruby 1.9.3, rails 3.2.9.
I already try to restart, same problem.
My form is :
%h1 Contact
= form_for @contact, :url => contacts_path do |f| = render 'shared/errors', object: f.object
%div
= f.label :email, "Email"
= f.text_field :email
%div
= f.label :name, "Nom"
= f.text_field :name
%div
= f.label :subject, "Objet"
= f.text_field :subject
%div
= f.label :message, "Message"
= f.text_area :message
%div.no-border
= f.submit 'Envoyer', :class => "button"
What is the path your template is saved as? Is error undefined method name for nil? I think your @contact object may be nil depending on if your customizing the controller or using the wrong template path.
Oops I use gem 'contact_us'
instead of gem 'contact_us', '~> 0.4.0'
now it's work. :) sorry for the inconvenience
hi,
i add on my /config/initializers/contact_us.rb file config.require_name = true config.require_subject = true as said on your description.
Then i add in my form :
And i have this error : undefined method `name'
What's wrong ?
Thx :)