0

このガイドに従いましたhttps://rubyonrailshelp.wordpress.com/2014/01/08/rails-4-simple-form-and-mail-form-to-make-contact-form/

連絡先フォームで、ユーザーは名前と電子メールのフィールドにメッセージとともに入力します。

class ContactForm < MailForm::Base

  attribute :name,      :validate => true
  attribute :email,     :validate => /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
  attribute :message
  attribute :nickname,  :captcha  => true

  # Declare the e-mail headers. It accepts anything the mail method
  # in ActionMailer accepts.
  def headers
    {
      :subject => "My Contact Form",
      :to => "FILLTHISIN@example.com",
      :from => %("#{name}" <#{email}>)
    }
  end
end

属性から自動的に送信しuser.email、ユーザーがフィールドに入力しないようにしたい。これは可能ですか?

4

1 に答える 1