如何在网格视图中的同一页面上显示表单上的内容?

时间:2014-01-22 11:46:06

标签: ruby ruby-on-rails-3 forms ruby-on-rails-4 rendering

我正在创建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>

问题: -  它不显示任何错误但不显示内容。 感谢。

0 个答案:

没有答案