Posts

Showing posts from March, 2010

Creating our First Grails Application (e.g. racetrack)

Image
command prompt> grails create-app racetrack command prompt> cd racetrack command prompt\racetrack> grails run-app Open your browser to http://localhost:8080/racetrack/   Directory Structure   From this information, we can see that we’re basically working with two types of data –races and registrations – and that there’s a one-to-many relationship between those entities. That information will form the basis of our domain model, and the various data elements on the form will become the attributes of our domain classes.  Create-Domain-Class racetrack> grails create-domain-class Race class Race { String name Date startDateTime String city String state Float distance Float cost Integer maxRunners = 100000 static hasMany = [registrations:Registration] } racetrack> grails create-domain-class Registration class Registration { Race race String name Date dateOfBirth String gender = 'F' String emailAddress String postalAddress Date crea