BackboneJS與Rails
Earlier this summer I had the opportunity to speak at a fantastic regional conference,Magma Rails.
The location is not what you might expect, being an off-the-beaten-path part of Mexico. There are no crowds of American and European touristas — well none outside of the crowd of non-Mexican rubyists.
On the other hand, you are deep in Mexico, midway along the Pacific coast, with nice beaches and lovely mountains. The sponsors, Mexican rubyists, and people in general are genial and engaging, making us touristas feel right at home.
The original talk topic was going to be Cucumber, instead I opted1 for talk titled Getting started with Backbone and Rails, 25 things you need to know (ShowOff slides). The talk has a fair bit of code, drawn from a working example. The example app was going to be released after the conference…
…and, long story short, that never2 happened…
…until now!
The location is not what you might expect, being an off-the-beaten-path part of Mexico. There are no crowds of American and European touristas — well none outside of the crowd of non-Mexican rubyists.
On the other hand, you are deep in Mexico, midway along the Pacific coast, with nice beaches and lovely mountains. The sponsors, Mexican rubyists, and people in general are genial and engaging, making us touristas feel right at home.
The original talk topic was going to be Cucumber, instead I opted1 for talk titled Getting started with Backbone and Rails, 25 things you need to know (ShowOff slides). The talk has a fair bit of code, drawn from a working example. The example app was going to be released after the conference…
…and, long story short, that never2 happened…
…until now!
[b]An example app[/b]
The app is incomplete, lacking tests, and written for clarity not conciseness. All of the JavaScript. code is written in CoffeeScript3. The Rails code is mostly scaffolding. You can find the source on github.
Over roughly 22 commits, the app is transformed into a one-page Backbone app that:
1. shows a list of movies
2. allows drilling into a specific movie
3. can add a new movie
4. can deleted an existing movie
5. sorts the list of movies
6. allows deep links directly to a specific movie
The app demonstrates how to structure a Backbone app for use with the asset pipeline, how to write views, handle forms, and interact with models, and how to fit Backbone in with Rails.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-743726/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Rails與web安全[Web安全大家談]薦AIWeb
- [Rails學習之路]Rails路由配置AI路由
- 精簡版的Rails框架->Rails::APIAI框架API
- 三大JavaScript框架對比——AngularJS、BackboneJS和EmberJSJavaScript框架AngularJS
- Hprose-ruby與Rails結合使用心得ROSAI
- 【棧】RailsAI
- Ruby on Rails 生成指定版本的 Rails 專案AI
- rails on ruby,ruby on rails 之程式碼塊(二)AI
- Rails專案中jRuby與Scala的互動AI
- 從Rails到Clojure再到Java,最後回到RailsAIJava
- Rails Security (上)AI
- Rails安裝AI
- Rails Code QuestionsAI
- [ruby] rails renderAI
- Rails分頁AI
- Rails的模板AI
- Modular Rails: The complete Guide to Modular Rails Applications 筆記AIGUIIDEAPP筆記
- ruby on rails 小技巧AI
- Rails 一對多AI
- rails graphql的使用AI
- rails 配置使用mysqlAIMySql
- Rails 4.0.1 釋出AI
- Rails 3.2.7 釋出AI
- Ruby on Rails 相關AI
- Ruby On Rails 技術AI
- Ruby on Rails:開源技術將深入企業 - [Matrix - 與 Java 共舞]AIJava
- [譯] 如何使用 Rails HelperAI
- Ruby on Rails Ping ++ 支付AI
- Rails常用gem總結AI
- 部署rails遇到問題AI
- Rails中的Helper方法AI
- rails4.0 session activerecordAISession
- 微信紅包介面呼叫(rails)AI
- rails git工作流程AIGit
- Rails動態find_byAI
- RubyStack now with Rails 3.2.7 and VarnishAI
- What is the difference between <%, <%=, <%# and -%> in ERB in Rails?AI
- do |r| Ruby & Rails endAI