the problem is in routes:
get "static_pages/contact"
post "static_pages/contact"
when you are accessing contact page you are calling a post request that normally sends empty values for name ant other attributes.
I'd remove the post "static_pages/contact"
line and leave the form to use create action when hitting the submit.
def contact
@contact = Contact.new
end
contacts_controller.rb
def create
@contact = Contact.new(params[:contact])
if @contact.save
ContactMailer.sent(@contact).deliver
redirect_to :action => @contact, :notice => 'お問い合わせありがとうございました。'
else
render :action => 'new' :alert => 'お問い合わせに不備があります。'
end
end
add add resources :contacts, :except => [:show]
to routes.rb