联系页面以在其他视图中调用<%= render' preorder / homepage / contact' %GT;

时间:2015-04-21 13:20:39

标签: ruby-on-rails ruby ruby-on-rails-4

我有脚手架生成的预订单,索引页面为

  <ul class="nav nav-tabs" role="tablist" id="myTab">
<li role="presentation" class="active"><a href="#detail" aria-controls="detail" role="tab" data-toggle="tab">Detail</a></li>
<li role="presentation"><a href="#news" aria-controls="news" role="tab" data-toggle="tab">News</a></li>
<li role="presentation"><a href="#presskit" aria-controls="presskit" role="tab" data-toggle="tab">Press Kit</a></li>

接触   评论   

<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="detail">
<%= render 'preorder/homepage/details' %>
<div role="tabpane1" class="tab-pane" id="news">
<%= render 'preorder/homepage/news' %>
</div>
<div role="tabpanel" class="tab-pane" id="presskit">
<%= render 'preorder/homepage/presskit' %>
</div>
<div role="tabpanel" class="tab-pane" id="presskit">
<%= render 'preorder/homepage/contact' %>
</div>
<div role="tabpanel" class="tab-pane" id="comment">
<%= render 'preorder/homepage/comment' %>
</div>

现在我已成功创建了联系人page form

现在我想将此联系表格整合为

<%= render 'preorder/homepage/contact' %>

我在preorder / hompage /添加了_contact.html.erb并添加了代码

<%= form_for @message, :url => contact_path do |form| %>

<div class="field">
<%= form.label :name %>
<%= form.text_field :name %>
</div>

它给我的错误:表格中的第一个参数不能包含nil或为空

请帮我解决此问题并实施联系页面

0 个答案:

没有答案