Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
very basic working list
- Loading branch information
1 parent
1ca62c8
commit 60ff321
Showing
10 changed files
with
127 additions
and
24 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import grails.plugin.emberscaffolding.test.* | ||
import java.text.SimpleDateFormat | ||
|
||
class BootStrap { | ||
|
||
def init = { servletContext -> | ||
def date = new SimpleDateFormat('yyyy-MM-dd') | ||
|
||
new Pirate(name: 'Edward Teach', nickname: 'Blackbeard').save(failOnError: true ) | ||
new Pirate(name: 'Jack Rackham', nickname: 'Calico Jack', dateOfBirth: date.parse('1682-12-21')).save(failOnError: true) | ||
} | ||
|
||
def destroy = { | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
modules = { | ||
'ember-scaffolding' { | ||
dependsOn 'ember' | ||
resource id: 'js', url: [plugin: 'ember-scaffolding', dir: 'js', file: "ember-scaffolding.js"] | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
grails-app/domain/grails/plugin/emberscaffolding/test/Pirate.groovy
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package grails.plugin.emberscaffolding.test | ||
|
||
class Pirate { | ||
|
||
String name | ||
String nickname | ||
Date dateOfBirth | ||
|
||
static constraints = { | ||
name blank: false | ||
dateOfBirth nullable: true | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!doctype html> | ||
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> | ||
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> | ||
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> | ||
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> | ||
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"><!--<![endif]--> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<title><g:layoutTitle default="Grails"/></title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="shortcut icon" href="${resource(dir: 'images', file: 'favicon.ico')}" type="image/x-icon"> | ||
<link rel="apple-touch-icon" href="${resource(dir: 'images', file: 'apple-touch-icon.png')}"> | ||
<link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file: 'apple-touch-icon-retina.png')}"> | ||
<link rel="stylesheet" href="${resource(dir: 'css', file: 'main.css')}" type="text/css"> | ||
<link rel="stylesheet" href="${resource(dir: 'css', file: 'mobile.css')}" type="text/css"> | ||
<g:layoutHead/> | ||
<r:layoutResources /> | ||
</head> | ||
<body> | ||
<div id="grailsLogo" role="banner"><a href="http://grails.org"><img src="${resource(dir: 'images', file: 'grails_logo.png')}" alt="Grails"/></a></div> | ||
<g:layoutBody/> | ||
<div class="footer" role="contentinfo"></div> | ||
<div id="spinner" class="spinner" style="display:none;"><g:message code="spinner.alt" default="Loading…"/></div> | ||
<r:layoutResources /> | ||
</body> | ||
</html> |
11 changes: 10 additions & 1 deletion
11
src/groovy/grails/plugin/emberscaffolding/ScaffoldingHelper.groovy
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
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var App = Ember.Application.create(); | ||
|
||
App.List = Ember.Object.extend({}); | ||
|
||
App.ListController = Ember.ArrayController.extend({}); | ||
|
||
App.ListView = Ember.View.extend({ | ||
controller: App.ListController, | ||
templateName: 'list' | ||
}); | ||
|
||
App.listController = App.ListController.create(); | ||
App.ListView.create({controller: App.listController}).appendTo('#content'); | ||
jQuery.getJSON("list", function(data) { | ||
App.listController.set('content', data); | ||
}); | ||
|
||
//App.Router = Ember.Router.extend({ | ||
// root: Ember.State.extend({ | ||
// index: Ember.State.extend({ | ||
// route: '/', | ||
// redirectsTo: 'list' | ||
// }), | ||
// list: Ember.State.extend({ | ||
// route: '/list', | ||
// connectOutlets: function(router) { | ||
// router.get('applicationController').connectOutlet(App.ListView, App.List.find()); | ||
// } | ||
// }) | ||
// }) | ||
//}); |