【问题标题】:semantic_form text clears on click from textbox in edit form从编辑表单中的文本框单击时,semantic_form 文本会清除
【发布时间】:2013-01-13 03:10:33
【问题描述】:

我正在使用 gem 'formtastic', '2.1' 我的模型: 员工.rb

class Employee < ActiveRecord::Base
  attr_accessible :name, :designation, :about
end

我的观点(edit.html.erb)

<%= semantic_form_for [:admin,@employee], :html => { :multipart => true, :class =>"form" } do |f| %>
  <%= f.inputs do %>
    <%= f.input :name, :hint => "should be less then or equal to 30 characters" %>
    <%= f.input :designation %>
    <%= f.input :about, :input_html => { :rows => 5 } %>
  <% end %>

  <%= f.buttons do |button| %>
    <button class="button" type="submit">
    </button>
  <% end %>
<% end %>

现在,当我尝试编辑此页面并单击文本框时,所有文本都被清除。 但我只想编辑(附加或更改数据) 我该怎么做?

【问题讨论】:

    标签: ruby-on-rails ruby forms semantics formtastic


    【解决方案1】:

    嗯,我自己的 javascript 有问题,它在模糊时清除文本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-23
      • 1970-01-01
      • 2012-02-04
      • 2011-10-21
      • 1970-01-01
      • 2012-06-26
      • 1970-01-01
      相关资源
      最近更新 更多