rails new try_hw_scaffold --skip-javascript
cd try_hw_scaffold
tmux
./bin/bundle remove jbuilder
./bin/bundle add hotwire-rails
./bin/rails hotwire:install
./bin/bundle install
./bin/rails g scaffold message title content:text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: bin/rails server -p 3000 | |
redis: redis-server /usr/local/etc/redis.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= tag.li id: convert.id do %> | |
<%= tag.span convert.status_summary %> | |
<%= tag.span do %> | |
<% out_file_path = rails_blob_path(convert.out_file) if convert.out_file.attached? %> | |
<%= link_to_if(convert.succeeded?, 'Download', out_file_path) { "N/A" } %> | |
<% end %> | |
<%= tag.span convert.message %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@startuml submitBubbled | |
hide footbox | |
== == | |
note over Session: new | |
create Navigator | |
Session -> Navigator: new | |
create PageView | |
Session -> PageView: new | |
create BrowserAdapter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@startuml visit | |
hide footbox | |
note over Session: new | |
create Navigator | |
Session -> Navigator: new | |
create History | |
Session -> History: new | |
create PageView | |
Session -> PageView: new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@startuml renderPage | |
hide footbox | |
note over PageView: renderPage | |
create PageRenderer | |
PageView -> PageRenderer: new | |
PageView -> PageView: render | |
PageView -> PageRenderer: isPreview, shouldRender, newSnapshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://unpkg.com/stimulus/dist/stimulus.umd.js"></script> | |
<script> | |
(() => { | |
const application = Stimulus.Application.start() | |
application.register("checkbox-effects", class extends Stimulus.Controller { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def form_data_window_confirm(message) | |
{ | |
'data-controller' => 'window_confirm', | |
'data-window_confirm-message-value' => message, | |
'data-action' => 'turbo:submit-start->window_confirm#show', | |
'data-turbo-frame' => '_top' | |
} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def form_data_window_confirm(message) | |
{ | |
'data-controller' => 'window_confirm', | |
'data-window_confirm-message-value' => message, | |
'data-action' => 'window_confirm#show' | |
} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# メッセージコントローラに下書き用のコントローラを追加する。 | |
# サブリソースのフィルタリング index # 下書き一覧を表示する | |
# サブリソースのアクション create # 下書きにする、destroy # 清書にする | |
# confing/routes.rb | |
Rails.application.routes.draw do | |
namespace :messages do | |
resources :drafts, only: :index | |
end | |
resources :messages do | |
resource :draft, only: %i[create destroy], module: 'messages' |