Hanami views are designed to work with dependencies from across your app. Using dependencies is how your view can retrieve the values it needs to include in its template.
To include dependencies, use the Deps mixin:
# app/views/books/show.rb
include Deps["repos.book_repo"]
expose :book do
book_repo.get!(id)
end
end
end
end
end
From here, you can use these dependencies within your exposures.