Skip to content

Instantly share code, notes, and snippets.

@radar
Forked from andrewhl/application.html.erb
Created February 16, 2012 17:38
Show Gist options
  • Select an option

  • Save radar/1846653 to your computer and use it in GitHub Desktop.

Select an option

Save radar/1846653 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Site</title>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= javascript_include_tag "success" %>
<%= csrf_meta_tags %>
</head>
<body class="<%= yield(:class) %>">
<div id="container">
<% flash.each do |key, value| %>
<%= content_tag(:div, value, :class => "flash #{key}") %>
<% end %>
<%= yield %>
</div>
<!-- <%= debug(params) if Rails.env.development? %> -->
</body>
</html>
$(document).ready(function() {
$('#my-link').click(function(event){
alert('Hooray!');
event.preventDefault(); // Prevent link from following its href
});
})
<%= link_to 'Link with unobtrusive JavaScript', '#', :id => 'my-link' %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment