To just run everything, execute this
command:
jruby script/server
CHAPTER 4 ?– STORE ADMINISTRATION 40
If you have configured the database correctly, and there are no exceptional errors in your
code that would make everything crash during startup, you??™ll see some startup messages from
Mongrel, telling you that it has started and is listening on port 3000. So, just point your web
browser at http://localhost:3000/ and you should see be able to see the Rails status page.
The server script takes several parameters. The two most interesting are -e and -p. With -p
you can set which port Mongrel should listen on, and with -e you can specify that Mongrel should
start with another runtime environment than the default (which is development).
From now on you should just leave Mongrel running in the background so you can check
your results easily, whenever you have changed anything.
Of course, if you??™d like to try running with WEBrick, or any other web server, you can do
that by naming it on the command line like this:
jruby script/server webrick
If Rails can find the web server, it will start using that instead.
A First Model
After you??™ve generated the new application and tested that your database configuration is
sound by starting up the web server, it??™s time to create the first parts of your model. You??™ll create
three different model classes here, define their relationship, and then create the migrations
for them. You??™ll generate the models associated with products first, because that??™s the first part
of the administrative user interface you??™ll create.
Pages:
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112