Created
June 19, 2012 14:38
-
-
Save caike/2954563 to your computer and use it in GitHub Desktop.
Including js dynamically
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 include_user_javascript | |
if controller.controller_name == 'users' | |
javascript_include_tag 'users' | |
end | |
end | |
end |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>CodeTV</title> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> | |
<%= include_user_javascript %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body> | |
<%= yield %> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment