I’m using unobtrusive javascript for passing game values (name, players hand) via API call to controller. Controller then process values from params and calls Processor which handles AI hand (very simple random selection), results of a game and storing results.
Result of a game is displayed based on API response.
There is a table of previous results. Players name is just text field bcs I didn’t add more complexity.
-
Clone this repository
-
Install Ruby -v >= 2.3.1
-
Install gem Bundler
-
Run bundle install
-
Run rake db:setup and rake db:migrate
-
Run rails server
-
That’s it