Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

using haml, working on mustache templating

  • Loading branch information...
commit 6b2f6b371964c70523a08d08240d91b94e7bd17b 1 parent 62f937b
@sellittf sellittf authored
View
4 Gemfile
@@ -1,6 +1,6 @@
source 'http://rubygems.org'
-gem 'rails', '3.1.0.rc1'
+gem 'rails', '3.1.0.rc4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -9,9 +9,11 @@ gem 'sqlite3'
# Asset template engines
gem 'json'
+gem 'haml'
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
+gem 'sprockets', '2.0.0.beta.10' #tmp# 2.0.0.beta.11 doesn't work
gem 'jquery-rails'
View
79 Gemfile.lock
@@ -1,37 +1,37 @@
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.0.rc1)
- actionpack (= 3.1.0.rc1)
+ actionmailer (3.1.0.rc4)
+ actionpack (= 3.1.0.rc4)
mail (~> 2.3.0)
- actionpack (3.1.0.rc1)
- activemodel (= 3.1.0.rc1)
- activesupport (= 3.1.0.rc1)
+ actionpack (3.1.0.rc4)
+ activemodel (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
builder (~> 3.0.0)
erubis (~> 2.7.0)
- i18n (~> 0.6.0beta1)
- rack (~> 1.3.0.beta2)
+ i18n (~> 0.6)
+ rack (~> 1.3.0)
rack-cache (~> 1.0.1)
rack-mount (~> 0.8.1)
rack-test (~> 0.6.0)
- sprockets (~> 2.0.0.beta.5)
+ sprockets (~> 2.0.0.beta.10)
tzinfo (~> 0.3.27)
- activemodel (3.1.0.rc1)
- activesupport (= 3.1.0.rc1)
+ activemodel (3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
bcrypt-ruby (~> 2.1.4)
builder (~> 3.0.0)
- i18n (~> 0.6.0beta1)
- activerecord (3.1.0.rc1)
- activemodel (= 3.1.0.rc1)
- activesupport (= 3.1.0.rc1)
+ i18n (~> 0.6)
+ activerecord (3.1.0.rc4)
+ activemodel (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
arel (~> 2.1.1)
tzinfo (~> 0.3.27)
- activeresource (3.1.0.rc1)
- activemodel (= 3.1.0.rc1)
- activesupport (= 3.1.0.rc1)
- activesupport (3.1.0.rc1)
+ activeresource (3.1.0.rc4)
+ activemodel (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
+ activesupport (3.1.0.rc4)
multi_json (~> 1.0)
- arel (2.1.1)
+ arel (2.1.3)
bcrypt-ruby (2.1.4)
builder (3.0.0)
coffee-script (2.2.0)
@@ -39,14 +39,15 @@ GEM
execjs
coffee-script-source (1.1.1)
erubis (2.7.0)
- execjs (1.1.1)
+ execjs (1.2.0)
multi_json (~> 1.0)
- hike (1.0.0)
+ haml (3.1.2)
+ hike (1.1.0)
i18n (0.6.0)
- jquery-rails (1.0.9)
+ jquery-rails (1.0.12)
railties (~> 3.0)
thor (~> 0.14)
- json (1.5.1)
+ json (1.5.3)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -63,22 +64,24 @@ GEM
rack
rack-test (0.6.0)
rack (>= 1.0)
- rails (3.1.0.rc1)
- actionmailer (= 3.1.0.rc1)
- actionpack (= 3.1.0.rc1)
- activerecord (= 3.1.0.rc1)
- activeresource (= 3.1.0.rc1)
- activesupport (= 3.1.0.rc1)
+ rails (3.1.0.rc4)
+ actionmailer (= 3.1.0.rc4)
+ actionpack (= 3.1.0.rc4)
+ activerecord (= 3.1.0.rc4)
+ activeresource (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
bundler (~> 1.0)
- railties (= 3.1.0.rc1)
- railties (3.1.0.rc1)
- actionpack (= 3.1.0.rc1)
- activesupport (= 3.1.0.rc1)
+ railties (= 3.1.0.rc4)
+ railties (3.1.0.rc4)
+ actionpack (= 3.1.0.rc4)
+ activesupport (= 3.1.0.rc4)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
+ rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
- sass (3.1.2)
+ rdoc (3.8)
+ sass (3.1.4)
sprockets (2.0.0.beta.10)
hike (~> 1.0)
rack (~> 1.0)
@@ -88,8 +91,8 @@ GEM
tilt (1.3.2)
treetop (1.4.9)
polyglot (>= 0.3.1)
- tzinfo (0.3.27)
- uglifier (0.5.4)
+ tzinfo (0.3.29)
+ uglifier (1.0.0)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
@@ -98,9 +101,11 @@ PLATFORMS
DEPENDENCIES
coffee-script
+ haml
jquery-rails
json
- rails (= 3.1.0.rc1)
+ rails (= 3.1.0.rc4)
sass
+ sprockets (= 2.0.0.beta.10)
sqlite3
uglifier
View
6 app/assets/javascripts/application.js
@@ -4,11 +4,9 @@
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
+//= require underscore
//= require jquery
//= require jquery_ujs
-//= require_tree .
-
//= require backbone
//= require ICanHaz
-
-//= require people
+//= require_tree .
View
22 app/assets/javascripts/people.js.coffee
@@ -13,16 +13,30 @@ class PersonCollection extends Backbone.Collection
model: Person
+$ ->
+ collection = new PersonCollection
+ collection.fetch()
+ html = ich.people(collection)
+ $("body").append(html)
+
+
+
+
+#collection.each (x) ->
+# alert x
+
+
+
+
+
+
+
#a = new Person({name: "Hans"})
#a.fetch()
#a.set({name: "my second name"})
#a.name = "my second name";
#a.save()
-window.c = new PersonCollection
-window.c.fetch()
-window.c.each (x) ->
- alert x
#class PersonView extends Backbone.View
# el: ".my_id",
View
3  app/views/layouts/application.html.erb
@@ -2,9 +2,8 @@
<html>
<head>
<title>Backbone</title>
- <%= stylesheet_link_tag "application" %>
- <%= javascript_include_tag "underscore" %>
+ <%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
View
11 app/views/people/index.html.erb → app/views/people/index.html.erb.old
@@ -20,13 +20,4 @@
<br />
-<%= link_to 'New Person', new_person_path %>
-
-
-<script id="person" type="text/html">
- <li>
- <p class="name">Hello I'm {{ name }}</p>
- </li>
-</script>
-
-<div class="my_id"></div>
+<%= link_to 'New Person', new_person_path %>
View
20 app/views/people/index.html.haml
@@ -0,0 +1,20 @@
+%script#person_show{:type => "text/html"}
+ %li
+ %p.name
+ {{ name }}
+
+
+%script#people{:type => "text/html"}
+ %ul
+ {{#models}}
+ {{ name }}
+ {{/models}}
+
+%script#person_index{:type => "text/html"}
+ %li
+ %p.name
+ {{ name }}
+
+
+/.my_id
+
Please sign in to comment.
Something went wrong with that request. Please try again.