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
View Asset Pipeline Integration
Search
nicolai86
October 30, 2011
Programming
2
200
View Asset Pipeline Integration
A short example on how to move you're views into the asset pipeline using HAML & Handlebars
nicolai86
October 30, 2011
Tweet
Share
More Decks by nicolai86
See All by nicolai86
Migrating Monolith Rails 2.x Applications using SSO
nicolai86
1
190
Other Decks in Programming
See All in Programming
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
9
4.2k
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.1k
禅の心を手に入れよ
eltociear
1
280
Elm Form Validation
bkuhlmann
0
510
Milestoner
bkuhlmann
1
410
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
970
SIMD Parallel Programming with the Vector API
josepaumard
0
220
使ってみよう Azure AI Document Intelligence
kosmosebi
2
360
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
320
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
Next.js App Router
quramy
11
1.6k
Tailwind CSSを本気でカスタマイズする方法
fsubal
14
5.4k
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
A Modern Web Designer's Workflow
chriscoyier
689
190k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
660
120k
Gamification - CAS2011
davidbonilla
77
4.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.4k
Happy Clients
brianwarren
92
6.4k
Teambox: Starting and Learning
jrom
128
8.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
The Mythical Team-Month
searls
216
42k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
What’s in a name? Adding method to the madness
productmarketing
PRO
17
2.7k
Transcript
Asset Pipeline Integration Raphael Randschau w e l u s
e G m b H Sunday, October 30, 11
current state Sunday, October 30, 11
our GOAL first visit Sunday, October 30, 11
our GOAL subsequent visits Sunday, October 30, 11
our GOAL view assembled on the client-side thin controllers fast
page load times! less load! single-page application interesting things can be achieved: - 100% offline apps AppCache - Sunday, October 30, 11
welcome to the asset pipeline not build for view- construction
write HTML yourself no Helper localization won’t do Sunday, October 30, 11
some problems rendering & templating engine ActionView::Helpers attribute binding localization
authorization Sunday, October 30, 11
partial solutions haml_assets haml_handlebars_assets template engine Sunday, October 30, 11
partial solutions haml_assets haml_handlebars_assets = hbs_form_for :user do |f| =
f.text_field :name template engine Sunday, October 30, 11
partial solutions haml_assets haml_handlebars_assets = hbs_form_for :user do |f| =
f.text_field :name template engine Sunday, October 30, 11
partial solutions <form> <input type=”text” value=”{{name}}” /> </form> haml_assets haml_handlebars_assets
= hbs_form_for :user do |f| = f.text_field :name template engine Sunday, October 30, 11
partial solutions Routes handlebars_routes_assets Sunday, October 30, 11
partial solutions r.edit_user_path Routes handlebars_routes_assets Sunday, October 30, 11
partial solutions r.edit_user_path Routes handlebars_routes_assets /users/{{id}}/edit Sunday, October 30, 11
partial solutions = hbs_form_for :user, action: r.edit_user_path, method: :put do
|f| = f.text_field :name <form action=”/users/{{id}}/edit” method=”put”> <input type=”text” value=”{{name}}” /> </form> Sunday, October 30, 11
partial solutions t(:‘hello.world’) Localization jquery-localization-engine Sunday, October 30, 11
partial solutions t(:‘hello.world’) <span rel=”localize[hello.world]”> Hello World! </span> Localization jquery-localization-engine
Sunday, October 30, 11
partial solutions t(:‘hello.world’) <span rel=”localize[hello.world]”> Hello World! </span> $("[rel*=localize]").localize("locales/de") Localization
jquery-localization-engine Sunday, October 30, 11
partial solutions review HAML - rendering ActionView::Helpers handlebars templating dynamic
localization Sunday, October 30, 11
partial solutions questions integrate I18n into FormHelpers ? authorization in
the client? data-filter in the server? restore state when accessing URLs directly? Sunday, October 30, 11
samples https://github.com/leahpar/backbone-asset-pipeline-example http://nicolai86.eu Sunday, October 30, 11
Discussion Sunday, October 30, 11