javascript - Rails:In-place editing in edit form with submit button -
i want create edit form such display current user information text not in text filed , when user click on text turn text field , user can edit information . changes reflect in data base when user click on submit button. not in place editing , not default edit form mixture of behaviour of both features.
my form looks following .it not complete form these of fields of form.
<%= form_for @contact, :html => { :multipart => true, :class => "contact_form"} |f| %> <% if @contact.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@contact.errors.count, "error") %> prohibited contact being saved:</h2> <ul> <% @contact.errors.full_messages.each |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :f_name, "first name" %><br/> <%= f.text_field :f_name %> </div> <div class ="field"> <%= f.label :experience, "total years of experience "%><br/> <%= f.select :experience, (0...30),{},{:class => 'select'} %> </div> <div class="field"> <%= f.label :l_name, "last name" %><br/> <%= f.text_field :l_name %> </div> <div class = "field"> <%= f.label :primary_practice_area, "primary practice area" %><br/> <%= f.select :primary_practice_area , metapracticearea.all.collect {|p| [ p.practice_area, p.id ] } %> </div> <div class = "field"> <%= f.label :phone, "phone" %><br/> <%= f.text_field :phone %> </div> <div class="actions"> <%= f.submit :class => "submit_btn" %> </div> <% end %>
and controller , model default.
you can try rest_in_place gem: https://github.com/janv/rest_in_place
Comments
Post a Comment