我正在创建replication form
。表单的内容需要显示在表单下方。
我的代码: -
IN employee.rb
class EmployeeController < ApplicationController
def emain
@replication = Replication.new
@repications = Replication.find(:all)
end
def create
@replication = Replication.new(params[:replication])
if @replication.save
flash[:success] = "Replication Added Successfully"
redirect_to employee_emain_path
end
else
redirect_to pages_home_path
end
end
(views/employee/emain
)中的: -
<div class = "container">
<hr>
<div class = "span9">
<div class = "well">
<%= render "/employee/form" %>
</div>
<hr>
Display all replication slip <br/>
<% if !@replications.blank? %>
<%= for item in (@replications) %>
<%= item.sr_no %>
<% end %>
<% else %>
<% end %>
</div>
问题: - 它不显示任何错误但不显示内容。 感谢。