November 2013
Intermediate to advanced
576 pages
19h 3m
English
Now that you have the basic project set up, you need to set up objects and controllers that can handle the two basic functions: capturing device tokens and receiving shouts. Rails has a function called a “scaffold” that will build out a model object, a controller, and basic views; you just need to specify the name of your object, and what attributes and data types you want. Rails automatically supports the following data types:
:binary :decimal :string:boolean :float :text:date :integer :time:datetime :primary_key :timestamp
First, set up your Shout object:
$ rails generate scaffold Shout ...
Read now
Unlock full access