Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Haron - Rails TagHelper Trial Horse
Search
wtnabe
December 01, 2012
Programming
0
76
Haron - Rails TagHelper Trial Horse
Introducing Haron, Rails TagHelper App on Rails
at Kanazawa.rb meetup #4
wtnabe
December 01, 2012
Tweet
Share
More Decks by wtnabe
See All by wtnabe
Rubyでもモノリポしたい - 調査、おわわり編 -
wtnabe
0
35
Ruby de Railway Oriented Programming
wtnabe
0
70
Bindanのススメ
wtnabe
0
46
そのオブジェクト、何を保証してくれますか? - GuideRailのススメ -
wtnabe
0
64
Effective Jekyll
wtnabe
0
92
5 min Jekyll/Liquid Plugin cooking
wtnabe
0
54
Ruby de Wasm
wtnabe
0
82
Cloud Native Buildpacksって結局どうなの?
wtnabe
0
66
Decoupled System with Turbo Frame
wtnabe
1
160
Other Decks in Programming
See All in Programming
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
5
1k
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
150
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
340
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8.1k
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.1k
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1.1k
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
120
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
230
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
140
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
340
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.3k
Windows on Ryzen and I
seosoft
0
290
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
Leo the Paperboy
mayatellez
4
1.5k
KATA
mclloyd
PRO
35
15k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
990
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
470
Crafting Experiences
bethany
1
87
Ruling the World: When Life Gets Gamed
codingconduct
0
170
Automating Front-end Workflow
addyosmani
1370
200k
Context Engineering - Making Every Token Count
addyosmani
9
750
The Pragmatic Product Professional
lauravandoore
37
7.2k
Transcript
Haron - Rails TagHelper Trial Horse - @wtnabe 2012-12-01(Sat) ⾦沢市⽂化ホール
Haronとは
何するものか RailsのTagHelper練習台 ブラウザで書いてブラウザで確認 だいたいrealtimeに変換
なんで作ったか Railsが得意でないデザイナ向け TagHelperをすぐに試せる環境 RailsでTagHelperの完全回避は無理
例えばimage_tag() <img src="">直書きは御法度 image_tag()でないと?serialが付かない <img src="/path/to/file.png?serial"> cache controlできない
Haronの実装技術
Rails 3.2 ActiveRecord ActiveDecorator Cells Ajax ( JSON )
Rails 3.2 機能的にはシンプルでRailsは不要 RailsのHelperを実際に動かすためにRails
ActiveRecord なくても作れそう 今回はscaffoldからスタートしたので
ActiveDecorator ViewコンテキストでだけModelをextend するModule Helperを使って<%= foo_bar_method( model ) %> Just <%=
model.method %>
Cells 独⽴したControllerとViewから成るView Widget partialでは収まりの悪い部品 Modelへのアクセスがあり様々なViewで 共通に使う部品 最近紹介されているが歴史は古いみたい
Ajax ( JSON ) scaffoldしたJSONのresponseに独⾃の情 報を付加 実際にTagとして変換できた場合だ けDOM更新 views/{C}/show.json.erb
keyup/down event handling realtimeっぽい部分 keyup + 500msでAjax -> DOM更新 keydownで上の流れをstop
続けてtypeしている間は黙って待つ
DEMO
ダメなところ evalを使っているのでサービス化不可 command injectionし放題 デザインとか考えてない feedbackもなくいきなりDOM更新
今後できたらいいな もうちょっと使いたくなるデザイン ActiveRecord撤廃 500 防⽌ ?
Enjoy Rails TagHelper :)