Add back button on edit view
This commit is contained in:
parent
f673a39b55
commit
e3fc106db1
|
@ -1,4 +1,4 @@
|
|||
<%= form_for @hydrant, :html => {:id => "abandon_form"} do |f| %>
|
||||
<%= form_for(@hydrant, :html => {:id => "abandon_form"}) do |f| %>
|
||||
<%= f.hidden_field "id" %>
|
||||
<%= f.hidden_field "user_id", :value => "" %>
|
||||
<%= f.hidden_field "name", :value => "" %>
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<%= form_for(:hydrant, :url => '/hydrant', :html => {:id => "back_form", :method => "get"}) do |f| %>
|
||||
<%= f.hidden_field "id" %>
|
||||
<%= f.submit "Back", :id => "back_form_submit" %>
|
||||
<% end %>
|
|
@ -1,4 +1,4 @@
|
|||
<%= form_for @hydrant, :html => {:id => "steal_form"} do |f| %>
|
||||
<%= form_for(@hydrant, :html => {:id => "steal_form"}) do |f| %>
|
||||
<%= f.hidden_field "id" %>
|
||||
<%= f.hidden_field "user_id", :value => "" %>
|
||||
<%= f.hidden_field "name", :value => "" %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%= form_for @hydrant, :html => {:id => "adoption_form"} do |f| %>
|
||||
<%= form_for(@hydrant, :html => {:id => "adoption_form"}) do |f| %>
|
||||
<h2>Adopt this Hydrant</h2>
|
||||
<%= f.hidden_field "id" %>
|
||||
<%= f.hidden_field "user_id", :value => current_user.id %>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<%= form_for :user, :url => edit_user_registration_path, :html => {:id => "edit_profile_form", :method => "get"} do |f| %>
|
||||
<%= form_for(:user, :url => edit_user_registration_path, :html => {:id => "edit_profile_form", :method => "get"}) do |f| %>
|
||||
<%= f.submit "Edit profile", :id => "edit_profile_form_submit" %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<%= form_for :sign_out, :html => {:id => "sign_out_form"} do |f| %>
|
||||
<%= form_for(:sign_out, :html => {:id => "sign_out_form"}) do |f| %>
|
||||
<%= f.submit "Sign out", :id => "sign_out_form_submit" %>
|
||||
<% end %>
|
||||
|
|
|
@ -17,3 +17,4 @@
|
|||
<%= f.password_field "current_password", :tabindex => 7 %>
|
||||
<%= f.submit "Update", :tabindex => 8, :id => "user_update_submit" %>
|
||||
<% end %>
|
||||
<%= render(:partial => 'hydrants/back') %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%= form_for :user, :html => {:id => "combo_form"} do |f| %>
|
||||
<%= form_for(:user, :html => {:id => "combo_form"}) do |f| %>
|
||||
<h2>Adopt this Hydrant</h2>
|
||||
<div id="common_fields">
|
||||
<%= f.label "email", "Email address", :id => "user_email_label" %>
|
||||
|
|
|
@ -677,4 +677,23 @@ $(function() {
|
|||
}
|
||||
return false;
|
||||
});
|
||||
$('#back_form').live('submit', function() {
|
||||
var submitButton = $("#edit_form input[type='submit']");
|
||||
$(submitButton).attr("disabled", true);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/hydrant',
|
||||
data: {
|
||||
'hydrant_id': activeHydrantId
|
||||
},
|
||||
beforeSend: function() {
|
||||
$('#info_window').hide();
|
||||
$('#loader').show();
|
||||
},
|
||||
success: function(data) {
|
||||
activeInfoWindow.setContent(data);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue