$30 off During Our Annual Pro Sale. View Details »
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
73
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 de Railway Oriented Programming
wtnabe
0
42
Bindanのススメ
wtnabe
0
30
そのオブジェクト、何を保証してくれますか? - GuideRailのススメ -
wtnabe
0
42
Effective Jekyll
wtnabe
0
71
5 min Jekyll/Liquid Plugin cooking
wtnabe
0
37
Ruby de Wasm
wtnabe
0
64
Cloud Native Buildpacksって結局どうなの?
wtnabe
0
53
Decoupled System with Turbo Frame
wtnabe
1
140
join-kanazawarb-or-7years-passed-since-it-was-borned
wtnabe
0
810
Other Decks in Programming
See All in Programming
これならできる!個人開発のすゝめ
tinykitten
PRO
0
110
開発に寄りそう自動テストの実現
goyoki
2
980
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
110
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
6
1.3k
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
470
Integrating WordPress and Symfony
alexandresalome
0
150
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
250
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
270
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
2.6k
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
420
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
120
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
0
520
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Designing for Performance
lara
610
69k
Agile that works and the tools we love
rasmusluckow
331
21k
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
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 :)