I am learning Sinatra and Rom. I forked the dusty sinatra-rom project on GitHub.
I run the program with
bundle exec rackup.
I am working through the issues. This one has me stumped:
undefined method relation for CreateProduct:Class (NoMethodError) relation :products
Here is the start of that file:
class CreateProduct < ROM::SQL::Commands::Create[:sql]
relation and the
register_as commands are not recognized.
sinatra-rom is very outdated. Please checkout GitHub - decafsucks/decafsucks: Rebuilding decafsucks.com as an OSS Hanami 2.0 example app. There you see how to use rom-rb properly. If you want to use sinatra, just check the code at decafsucks/persistence.rb at main · decafsucks/decafsucks · GitHub. But I recommend using hanami. You’ll be amazed ;).
Thanks, I will follow up on your suggestions.