Skip to content

Commit

Permalink
added readme.md and .gitignore to the generator, some more fixes for …
Browse files Browse the repository at this point in the history
…the realtime show page
  • Loading branch information
Techwraith committed Nov 3, 2012
1 parent 4b85ae4 commit 5f3e1e5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions templates/base/.gitignore
@@ -0,0 +1 @@
public/js/core/*
2 changes: 2 additions & 0 deletions templates/base/readme.md
@@ -0,0 +1,2 @@
# This is a Geddy App
Feel free to modify this file to your hearts content. We just put this here to remind you to add a readme file to your project. We also added a .gitignore file so it'll be really easy to host this code on github.
25 changes: 18 additions & 7 deletions templates/scaffold/realtime/views/ejs/show.html.ejs.ejs
Expand Up @@ -18,14 +18,25 @@
<%% } -%> <%% } -%>


<script type="text/javascript"> <script type="text/javascript">
$(function(){
geddy.io.addListenersForModels(['<%= names.constructor.singular %>']); var pageId = window.location.pathname.split('/')[2];
geddy.model.<%= names.constructor.singular %>.on('update', function (<%= names.property.singular %>){ geddy.io.addListenersForModels(['<%= names.constructor.singular %>']);
var properties = <%= names.property.singular %>.toData();
for (var i in properties) { geddy.model.<%= names.constructor.singular %>.on('update', function (<%= names.property.singular %>){
$('.'+i).text(properties[i]); if (<%= names.property.singular %>.id == pageId) {
} var properties = <%= names.property.singular %>.toData();
}); for (var i in properties) {
$('.'+i).text(properties[i]);
}
}
});
geddy.model.<%= names.constructor.singular %>.on('remove', function (id){
if (id == pageId) {
window.location = '/<%= names.property.plural %>';
}
});
});
</script> </script>

0 comments on commit 5f3e1e5

Please sign in to comment.