Report abuse

<script>
function afterReload(response) {
  $(".classroom_form").html($(".classroom_form", response))
}
$(function(){
  $('.reload').click(function(event) {
    $.ajax({
      url: this.href,
      type: 'get',
      success: afterReload
    });
    return false;
  })
})
</script>

<%= link_to 'Reload form using Ajax', edit_classroom_path(classroom), :class => 'reload' %>

<div class='classroom_form'>
  <p>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </p>
</div>