Here is a simple Rails Model and a Hyperstack Component. The Hyperstack Component uses Opal Ruby. Opal is a version of Ruby that runs on the Browser.
Hyperstack is a gem that wraps React with a Ruby DSL.
class Order < ApplicationRecord
...
scope :shipped, -> () { where(status: :shipped) }
...
end