migration
に hook
させて git
で
管理しよう!
%w(db:migrate db:schema:load).each do |task|
Rake::Task[task].enhance do
Rake::Task['mermaid_erd'].invoke if Rails.env.development?
end
end
Slide 19
Slide 19 text
あとはこうして
models/documentation.rb
module Documentation; end
Slide 20
Slide 20 text
こうして
ActiveAdmin.register Documentation do
actions :index
controller do
def index
redirect_to admin_documentations_erd_path
end
end
end
Slide 21
Slide 21 text
こうして
config/routes.rb
namespace :admin do
namespace :documentations do
resource :erd, only: :show, format: 'html'
end
end