Prev | Current Page 136 | Next

David Berube

"Practical Reporting with Ruby and Rails"

rb
create test/functional/home_controller_test.rb
create app/helpers/home_helper.rb
For this example, you will use the players_4 database from Chapter 3, so you will
need to edit your config/database.yml file to look something like Listing 5-9.
Listing 5-9. Database Configuration File for the Graphical Report (config/database.yml)
development:
adapter: mysql
database: players_4
username: your_mysql_username_here
password: your_mysql_password_here
host: localhost
As in the previous example, you??™re creating only a development environment at this
point, so you can safely ignore the other two database connection settings for testing
and production.
Place the code shown in Listing 5-10 in config/routes.rb.
Listing 5-10. Application Routing Code (config/routes.rb)
ActionController::Routing::Routes.draw do |map|
map.connect 'performance/:game_id/:player_id',
:controller=>'performance',
:action=>'show'
map.connect 'performance/:game_id/:player_id.:format',
:controller=>'performance',
:action=>'show'
map.


Pages:
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
zmywarki Maxïmo Park Giorgio Moroder Manic Street Preachers Lizar