Created
June 8, 2011 16:19
-
-
Save ovargas27/1014746 to your computer and use it in GitHub Desktop.
Modal dialog with jQuery UI
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
<%= link_to 'New brand', '#new-brand-link', {:id => "new-brand-link"} %> | |
<div id="new-brand-form" title="Create new brand"> | |
<%= form_for [:admin, @brand], :remote => true do |form| %> | |
<%= form.label :name %> | |
<%= form.text_field :name %><br /> | |
<%= form.submit 'Save' %><br /> | |
<% end %> | |
</div> | |
<% content_for :javascripts do %> | |
<script> | |
$(document).ready(function(){ | |
$("#new-brand-form" ).dialog({ autoOpen: false, modal: true }); | |
$("#new-brand-link" ).click(function() { | |
$("#new-brand-form" ).dialog( "open" ); | |
}); | |
}); | |
</script> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment