The application had two controllers: Products and Clients. We added to the Products controller a function that shows a static message when we click on the button. Now we want to fetch the data to display from the database.

Each time we start the application, the closure in db.js run the migrations not already executed. We can run the app to create the table then add some fake data with a SQLite manager. Alternatively we can create another migration to add sample data, it’s up to you.

With this fourth part we conclude this series of tutorials. It’s not too much, just a start but we are planning to create a new series of tutorials in september that will cover the coding of a complete application with Appcelerator on Rails.

If you are talking about migration you already can do that. “migrate” function simply execute SQL code so you can write everything you want.

If you are talking about the “active_db” structure instead, is a good idea don’t do that because it implements something similar to Ruby’s ActiveRecord. It enables you to map your object on the corresponding row on the DB so multiple insert aren’t usefull.

Bye

tcd

Any idea why this will not compile in titanium 1.7.5? Only works in 1.7.1 otherwise I get this error: