Currently, I am using chessboard-0.3.0.js in a rails application. Due to the rails asset pipeline setup, I've had to make adjustments to the js code specifically related to rendering images, such as Pieces. In line 445 of chessboard.js, it states:
cfg.pieceTheme = 'img/chesspieces/wikipedia/{piece}.png'
This posed an issue for rails, so I renamed chessboard with the .erb extension and modified that line to:
cfg.pieceTheme = <%= asset_path('chesspieces/wikipedia/{piece}.png') %>
After placing all the required images in the assets/images folder.
The problem lies in the fact that the images are still not being rendered. My assumption is that the placement of {piece}.png
in that line might be causing the issue since it's essentially js inside a rails helper, correct? This could be why my images aren't showing up.
Going through the entire 'almost 2000' lines of code to individually access each image seems daunting, especially as a beginner, as it's easy to inadvertently cause more errors along the way.
Is there a solution to this predicament without having to extensively rewrite the code?