Prev | Current Page 269 | Next

David Berube

"Practical Reporting with Ruby and Rails"


However, there??™s a catch: the site has an extremely large amount of traffic, so whatever
method is used to analyze the data will need to be extremely fast; otherwise, it might
take hours or days to import all of the data. You would like to use a small set of test data
to compare different approaches to see which is fastest.
Let??™s cover exactly how you can accomplish these goals with Rails. To begin, you??™ll
need to install the ar-extensions, gruff, and pdf-writer gems, as follows:
gem install -y ar-extensions gruff pdf-writer
Next, create a new project with the following command:
rails apache_sales_tracker
Then enter the apache_sales_tracker directory and install the rpdf plug-in, as follows:
ruby script/plugin install svn://rubyforge.org//var/svn/railspdfplugin/railspdf/
Now, let??™s start creating the files that make up the application.
Creating the Controllers
First, create the controller for the main page, as shown in Listing 10-1.
Listing 10-1. Home Page Controller (app/controllers/home_controller.


Pages:
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
Little Eva Mafia Patrycja Markowska Midnight Oil Bob Marley