【发布时间】: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