woensdag 5 augustus 2009

HippoOnRails: Experiment 2

Introduction


In this experiment I'll show you how you can set up your own application within 15 minutes, with Hippo on Rails.

Prerequisite


For this to work you will need to have set up a working HippoOnRails example project.

Start up


Start the cms: mvn jetty:run-war

Open up the console and add another node to the root node, call it ToDos

Start the ruby server: jruby script/server

Next open up a console and generate the code with the normal ruby scaffold:
jruby -S script/generate scaffold todo deadline:date title:string description:text

Open up the model and extend the todo model from the jcr, add the columns (plus id column) and the table name, it should end up looking link this:
The set_new_record method is necessary to edit the node values, instead of creating new values each time. This is a result of the hack were using to set up this experiment.

Don't forget to ad an id column, rails needs this to create the urls for your model.

Now fire up your webbrowser once again, point it to http://localhost:3000/todos, and see your results.

This is it, it's this easy to set up a very basic application in HippoOnRails.

If you have any problems setting this up, don't hesitate to ask for help with your HippoOnRails experiment on our forum.

Geen opmerkingen:

Een reactie posten