Background: I created a checkers game engine in ruby, originally with a text based gui, then built a swing-like desktop gui, using Jruby. Now I’m trying to develop a Sinatra-based web interface for the view.
One essential task I need to cover is how to communicate board square clicks(such as getting the from and to squares for a movement) to the game engine via the routes. Is there a way to do this using just HTML and CSS or do I need to build-in some javascript to create this functionality? Thanks for any info and advanced apologies if there is ignorance in the question.
Javascript will be your best bet. Assuming you implement the interface with a table or any other html element. Try having a unique identifier for each block if you need different behavior for different block. And then you can use simply jquery to bind to the click event. For example you have a table and each td is a block.