I am using gem ‘formtastic’, ‘2.1’
my model:
employee.rb
class Employee < ActiveRecord::Base
attr_accessible :name, :designation, :about
end
my view(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 %>
Now when i try to edit this page and click on the textbox, all the text is cleared.
But i want to just edit(append or make changes to data)
how can i do that?
Well it was problem with my own javascript which was clearing text on blur.