<%% if not request.xhr? %> <%% end %> -#{@<%= singular_name %>.id}" %>" class="edit" <%%= "style=\"display: none;\"" if request.xhr? %> > <%% if not request.xhr? %>
<%%= form_remote_tag :url => { :controller => '<%= controller_name %>', :action => 'update', :id => @<%= singular_name %> }, :loading => "AjaxScaffold.updateOnLoading(request,'<%= singular_name %>',#{@<%= singular_name %>.id});", :success => "AjaxScaffold.updateOnSuccess(request,'<%= singular_name %>',#{@<%= singular_name %>.id});", :failure => "AjaxScaffold.updateOnFailure(request,'<%= singular_name %>',#{@<%= singular_name %>.id});", :html => { :action => url_for(:controller => '<%= controller_name %>', :action => 'update', :id => @<%= singular_name %>), :id => "edit-<%= singular_name %>-#{@<%= singular_name %>.id}-form" } %>

Edit <%= Inflector.titleize(singular_name) %>

<%% # Its actually okay to leave both of these elements (ex: form_errors will only generate HTML when in fallback mode) %> <%% if request.xhr? %>
-#{@<%= singular_name %>.id}-errors" %>" style="display: none;" >
<%% else %> <%%= render :partial => 'form_errors' %> <%% end %> <%%= render :partial => 'form' %>

<%%= submit_tag "Update", :class => "submit" %> <%%= link_to_function "Cancel", "AjaxScaffold.updateOnCancel('<%= singular_name %>',#{@<%= singular_name %>.id});", :href => url_for(:controller => '<%= controller_name %>', :action => 'return_to_main') %> <%%= loading_indicator_tag '<%= singular_name %>', "update-#{@<%= singular_name %>.id}" %>

<%%= end_form_tag %>
<%% end %>