rails new blog
cd blog
hanami new bookshelf
vim Gemfile # add `hanami`
bundle
vim bookshelf/config/environment.rb # See Note 1
# comment this line
# require 'hanami/model'
# comment this block
# mailer do
# # ...
# end
cd bookshelf
bundle exec hanami generate action web home#index --url=/
vim apps/web/templates/home/index.html.erb # add <h1>Hello from Hanami</h1>
cd ..
vim config/environment.rb # see Note 2
vim config/routes.rb # see Note 3 mount Hanami.app, at: "/bookshelf"
require_relative 'application'
require_relative "../bookshelf/config/boot"
# Initialize the Rails application.
Rails.application.initialize!
Rails.application.routes.draw do
mount Hanami.app, at: "/bookshelf"
end
bundle exec rails server
# visit http://localhost:3000/bookshelf