Prev | Current Page 130 | Next

David Berube

"Practical Reporting with Ruby and Rails"

It automatically uses Mongrel if it??™s installed. If Mongrel is not installed, it will use
WEBrick, and your output will be slightly different than what is shown in the book. However, it won??™t make a
difference for this example.
Figure 5-1. Ruby on Rails actor schedule
To view the report on a cell phone, you would need to run this application on a public
server. If you did so, and then used your cell phone to navigate to port 3000 on the
appropriate URL, you would see something similar to Figure 5-2 (of course, the exact
view depends on the cell phone model). Additionally, you would likely add authentication
and other real-world features before actually deploying this application. Nonetheless,
as you can see, the approach of using simple semantic HTML can work well even on
cell phones.
CHAPTER 5 n CONNECTING YOUR REPORTS TO THE WORLD 88
Figure 5-2. Ruby on Rails actor schedule on a Samsung A900 cell phone
Dissecting the Code
The bulk of the application is in the controller and the view, but before we get to that, let??™s
take a brief look at the migration (Listing 5-2), which defines the database schema for the
application:
class InitialSchema < ActiveRecord::Migration
def self.


Pages:
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
ciekawe zdania przeprowadzki katowice znaki drogowe poker no limit wizualizacje