使用户能够从下拉列表中选择5个项目

时间:2017-03-17 15:21:31

标签: ruby-on-rails ruby

我非常擅长使用rails并尝试在我的应用中构建一项功能,用户应该可以从下拉菜单中选择一项功能,该功能将在其展示页面上列出。

在编辑页面中,我有5个下拉菜单,但在显示页面中,它只获取第一个选定项目并重复5次。如果有人可以帮助我解决问题,那将是非常有帮助的! (尝试在这里找到类似的问题,但无法找到一个)

edit.html.erb

  </tr>
            <tr>
              <td> <%= select("user", "skills", User::SKILLS) %></td><BR>
            </tr>
            <tr>
              <td> <%= select("user", "skills", User::SKILLS) %></td><BR>
            </tr>
            <tr>
              <td> <%= select("user", "skills", User::SKILLS) %></td><BR>
            </tr>
            <tr>
              <td> <%= select("user", "skills", User::SKILLS) %></td><BR>
            </tr>
            <tr>
              <td> <%= select("user", "skills", User::SKILLS) %></td><BR>
            </tr>

show.html.erb

    <tr>
        <td>skills:</td>
        <td><%= current_user.skills %></td>
    </tr>

user.rb

     SKILLS = ["","Administrative", "Analytical", "Artistic/Creative", "Budgeting", "Communicaton", "Computer", "Conflict Reslution", "Creating Ideas", "Creating Procedures", "Creating New Solutions", "Customer Service", "Decision Making", "Fundraising", "Handling Complaints", "Innovative", "Leadership", "Learning", "Logical Thinking", "Maining High Levels of Activity", "Negotiating", "Networking", "Organizational", "Planning", "Problem Solving", "Reporting", "Team Work", "Technical", "Time Management", "Training"]

0 个答案:

没有答案