...
2. Create Models, Migrations and Sample Data
(a) Create the models
First, generate some models for the sample data.
Code Block |
---|
rails g model supplyitem rails g model employee |
The smartclient gem uses mass-assignment, so you will need to enable that in the models.
Code Block | ||||
---|---|---|---|---|
| ||||
class Supplyitem < ActiveRecord::Base attr_accessible :itemName, :sku, :description, :category, :units, :unitCost, :inStock, :nextShipment, :created_at, :updated_at end |
Code Block | ||||
---|---|---|---|---|
| ||||
class Employee < ActiveRecord::Base attr_accessible :name, :reportsTo, :job, :email, :employeeType, :employeeStatus, :salary, :orgUnit, :gender, :maritalStatus, :created_at, :updated_at end |
(b) Define and Run Migrations
...