Created
October 1, 2011 19:58
-
-
Save cloke/1256573 to your computer and use it in GitHub Desktop.
Sample Rails App with SC 2
This file contains hidden or 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
| <!-- Application ERB --> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Diets</title> | |
| <%= stylesheet_link_tag "application" %> | |
| <%= csrf_meta_tags %> | |
| </head> | |
| <body> | |
| <%= yield %> | |
| <%= javascript_include_tag "application" %> | |
| </body> | |
| </html> | |
| <!--Home.erb--> | |
| <script type="text/x-handlebars"> | |
| {{#view Diets.MyView}} | |
| <h1>Hello world!</h1> | |
| {{/view}} | |
| </script> | |
| <!-- App JS --> | |
| //= require libs/sproutcore-2.0.beta.3 | |
| $(document).ready(function(event){ | |
| var Diets = SC.Application.create(); | |
| //Diets is created without issue, then the view fails. | |
| Diets.MyView = SC.View.extend({ | |
| mouseDown: function() { | |
| window.alert("hello world!"); | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment