Created
November 8, 2011 02:30
-
-
Save jmccaffrey42/1346840 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
// domain/myapp/Recipe.groovy | |
package myapp; | |
class Recipe { | |
String name | |
static constraints = { | |
} | |
} | |
// domain/myapp/Ingredient.groovy | |
package myapp; | |
class Ingredient { | |
String name | |
} | |
// controllers/myapp/RecipesController.groovy | |
package myapp | |
class RecipesController { | |
def index = { | |
def recipes = Recipe.findAll() | |
return [ recipes: recipes ] | |
} | |
def show = { | |
String id = params.id | |
def recipe = Recipe.get(id) | |
return [ recipe: recipe ] | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment