theFirehoseProject/chess — pull request #6 by ilyakrasnov (2014-11-21 11:59:01+00:00)
Title: Show board

What I've done:

* Change initialize_the_board! method to set x_coord and y_coord (instead of x and y)
* Add games controller with the show method
* Load the game pieces into the controller
* Create show view and copy the show table
* In each cell check every piece if it has the appropriate coordinates and display its color and type
* Change css style for black cells to white text color

How you can test it:

* run rails c in terminal
* run g = Game.create (creates new game go into your browser and check http://localhost:3030/games/1 - it should display an empty board)
* run g.initialize_the_board! in the terminal
* reload the page - it should display the pieces
* run g.pieces.last.update(:x_coord => 4, :y_coord => 3) and reload the page (you just moved a piece)

Questions:
Its a very expensive operation right now.. Any ideas how to do it less expensive?