I am trying to show/hide certain divs depending on the click of a button/link. I have done some reading on how to do this with JQuery, but it doesn't seem to be working.
edit.html.erb
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<div class="pad-bottom">
<a id="edit-profile-button" class="button default ok" href="#">
Edit Profile
</a>
<div id="profile-information" class="hidden">
<div class="row pad-top">
<div class="col-xs-6 col-sm-6 field-row">
<div class="roboto bold black field-label">
First
</div>
<%= f.text_field :first_name, class: 'field', placeholder: 'First Name'%>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(event){
$('#edit-profile-button').click(function(){
event.preventDefault();
$('#profile-information').toggle();
});
});
</script>
application.css
.hidden {
display: none;
}
I can click on the link and fall into a debugger and access the two elements that I try to select in the jQuery code, but it doesn't seem do be doing anything at all, the div is never made visible.