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
77
0
Share
Haron - Rails TagHelper Trial Horse
Introducing Haron, Rails TagHelper App on Rails
at Kanazawa.rb meetup #4
wtnabe
December 01, 2012
More Decks by wtnabe
See All by wtnabe
Rubyでもモノリポしたい - 調査、おわわり編 -
wtnabe
0
45
Ruby de Railway Oriented Programming
wtnabe
0
93
Bindanのススメ
wtnabe
0
58
そのオブジェクト、何を保証してくれますか? - GuideRailのススメ -
wtnabe
0
73
Effective Jekyll
wtnabe
0
95
5 min Jekyll/Liquid Plugin cooking
wtnabe
0
58
Ruby de Wasm
wtnabe
0
90
Cloud Native Buildpacksって結局どうなの?
wtnabe
0
74
Decoupled System with Turbo Frame
wtnabe
1
170
Other Decks in Programming
See All in Programming
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
330
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
7
2.3k
Modding RubyKaigi for Myself
yui_knk
0
470
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
110
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
350
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.2k
Moments When Things Go Wrong
aurimas
3
110
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
210
デフォルト運用のCodeRabbit、1年で何が変わったか / How CodeRabbit Changed Our Code Review in 1 Year
bake0937
1
110
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
130
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1k
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
6
1k
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
380
Automating Front-end Workflow
addyosmani
1370
210k
30 Presentation Tips
portentint
PRO
1
300
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
210
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
150
Color Theory Basics | Prateek | Gurzu
gurzu
0
320
WCS-LA-2024
lcolladotor
0
600
Building an army of robots
kneath
306
46k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
580
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
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 :)