Ruby on Rails复杂表格

时间:2016-06-16 09:02:24

标签: ruby-on-rails ruby

控制器

    def create
        radgroup1 = Radgroup.new(groupname: radgroup_params[:groupname],
                                 attribute: "MaxTimeLimit",
                                 op:        ":=",
                                 value:     radgroup_params[:time])

        radgroup2 = Radgroup.new(groupname: radgroup_params[:groupname],
                                 attribute: "MaxDownLimit",
                                 op:        ":=",
                                 value:     radgroup_params[:downlimit])

        radgroup3 = Radgroup.new(groupname: radgroup_params[:groupname],
                                 attribute: "MaxUpLimit",
                                 op:        ":=",
                                 value:     radgroup_params[:uplimit])

        respond_to do |format|
            if radgroup1.save && radgroup2.save && radgroup3.save

以下是表格:

    <%= form_tag "/radgroup_controller/create" do %>
      <%= text_field_tag "groupname", "default info" %>
      <%= text_field_tag "time", "default info" %>
      <%= text_field_tag "downlimit", "default info" %>
      <%= text_field_tag "uplimit", "default info" %>
      <%= submit_tag "Save" %>
    <% end %>

根据这个结构,我不能做索引页面。你能救我吗?

existing index page

我想要的索引页面,如图片

index page

0 个答案:

没有答案