Created
June 26, 2012 17:25
-
-
Save mmcc/2997231 to your computer and use it in GitHub Desktop.
destroy.js.erb not hiding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Controller | |
respond_to :html, :js | |
# DELETE /users/1 | |
def destroy | |
@student = User.find(params[:id]) | |
@student.destroy | |
respond_with(@student) | |
rescue | |
puts $!.inspect, $@ | |
render :nothing => true | |
end | |
# destroy.js.erb | |
console.log("Test if this is actually firing"); // Not logging to the console. | |
$('#<%= dom_id(@student) %>').hide(); // Hide the deleted record. | |
# View.haml | |
= link_to student_path(s), :class => "btn btn-mini btn-danger", :method => "delete", :confirm => "Are you sure you want to delete this student?", :remote => "true", :title => "Delete Student" do | |
%i.icon-remove |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment