Created
April 11, 2009 08:08
-
-
Save misfo/93499 to your computer and use it in GitHub Desktop.
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
$(function() { | |
alert("Hello from <%= params[:action] %>"); | |
}); |
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
$(function() { | |
alert("<%= Rails.version %>"); | |
}); |
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
<html> | |
<head> | |
<title>Super Awesome!!!11</title> | |
<%= javascript_include_tag 'jquery-1.3.2' %> | |
<%= yield :head %> | |
<%= default_javascript %> | |
</head> | |
<body> | |
<%= yield %> | |
</body> | |
</html> |
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
module ApplicationHelper | |
def default_javascript | |
js = "" | |
begin | |
js << render(:partial => "default.js") | |
rescue ActionView::MissingTemplate | |
end | |
begin | |
js << render(:partial => "#{params[:action]}.js") | |
rescue ActionView::MissingTemplate | |
end | |
javascript_tag(js) unless js.blank? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment