Skip to content

Instantly share code, notes, and snippets.

@lucapette
Created September 19, 2011 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucapette/1227583 to your computer and use it in GitHub Desktop.
Save lucapette/1227583 to your computer and use it in GitHub Desktop.
jquery ui tables in rails
<!DOCTYPE html>
<html>
<head>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
<%= yield(:head) %>
<%=javascript_tag "$(document).ready(init)" %>
</head>
<body>
<%= yield %>
</body>
</html>
function init() {
$('input:submit').button();
styleTables();
}
function styleTables() {
$(".table th").each(function(){
$(this).addClass("ui-state-default");
});
$(".table td").each(function(){
$(this).addClass("ui-widget-content");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment