我正在使用带有导轨的邮件程序,但是应该在哪里显示它的字段它什么也没显示。
观点是:
<% simple_form_for(@message, :url => mailer_new_path) do |f| %>
<%= f.error_notification%>
<div class="inputs">
<%=f.input :subject, :hint => "Write the subject here!"%>
<%=f.input :body, :as => :text%>
<div class="actions"%>
<%=f.button :submit , 'Send Email', :class => "primary btn"%>
<% end%>
邮件控制器:
class MailerController < ApplicationController
def new
@message = Message.new
end
end
消息.rb:
class Message
include MongoMapper::Document
key :username, String
key :subject, String
key :body, String
#validates_presence_of :username, :body
end
在路线中,我有:
get "mailer/new"
get "mailer/create"
有人能帮助我吗?提前致谢!