Prev | Current Page 281 | Next

David Berube

"Practical Reporting with Ruby and Rails"


Listing 10-10. Advertiser Model (app/models/advertiser.rb)
class Advertiser < ActiveRecord::Base
end
Listing 10-11. Hit Model (app/models/hit.rb)
class Hit < ActiveRecord::Base
end
Save these as app/models/advertiser.rb and app/models/hit.rb, respectively.
Examining the Log Analyzer and Cost-Per-Sale Report
To see the solution in action, you??™ll need some data. Download the sample advertiser list
from the Source/Downloads area of the Apress web site (http://www.apress.com) or from
http://rubyreporting.com/examples/apachetracker_sample_advertisers.sql.
You can import the data as follows:
mysql -u your_mysql_username_here -p apache_sales_tracker <
apachetracker_sample_advertisers.sql
You can run the server with the following command from the root of your Rails application:
ruby script/server
Open a web browser and surf to http://localhost:3000. You should see a page similar
to Figure 10-1. To upload an Apache log, click Browse, and then click the Upload with
Active Record button. You can grab a sample Apache log from either the Apress web site
or http://rubyreporting.


Pages:
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
Kąty Rybackie noclegi trener nlp ceny żywca leczenie alkoholizmu Kołobrzeg