Upgrade to Pro — share decks privately, control downloads, hide ads and more …

View Asset Pipeline Integration

nicolai86
October 30, 2011

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

More Decks by nicolai86

Other Decks in Programming

Transcript

  1. 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
  2. welcome to the asset pipeline not build for view- construction

    write HTML yourself no Helper localization won’t do Sunday, October 30, 11
  3. partial solutions haml_assets haml_handlebars_assets = hbs_form_for :user do |f| =

    f.text_field :name template engine Sunday, October 30, 11
  4. partial solutions haml_assets haml_handlebars_assets = hbs_form_for :user do |f| =

    f.text_field :name template engine Sunday, October 30, 11
  5. 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
  6. 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
  7. 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