Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

editing a person works too

  • Loading branch information...
commit 5c9649af5e80b019329d5534076dc6baed417d40 1 parent 303712d
Chris Nelson authored
View
3  example/Gemfile
@@ -18,12 +18,15 @@ group :assets do
gem "haml_coffee_assets"
gem "jasmine-ajax"
+ gem "jasminerice-runner"
gem "backtastic", :path => ".."
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "jasminerice"
+gem "capybara-webkit"
+
gem "inherited_resources"
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
View
4 example/app/assets/javascripts/backbone/routers/people_router.coffee
@@ -11,6 +11,7 @@ class Example.Routers.PeopleRouter extends Backbone.Router
routes:
"people/new": "newPerson"
"people/list": "showPeople"
+ "people/:id/edit": "editPerson"
showPeople: ->
@peopleView.render()
@@ -20,4 +21,7 @@ class Example.Routers.PeopleRouter extends Backbone.Router
person = new Example.Models.Person
@people.add person, silent: true
@editPersonView.edit(person)
+
+ editPerson: (id)->
+ @editPersonView.edit @people.get(id)
View
2  example/app/assets/templates/people_view_template.jst.hamlc
@@ -1,6 +1,6 @@
%ul
- for person in @collection.models
%li
- %a{href: '/people/#{person.id}'}= person.get("first_name")
+ %a{href: '#people/#{person.id}/edit'}= person.get("first_name")
%a{href: "#people/new"} Add Person
View
6 example/spec/javascripts/spec.js.coffee
@@ -1,3 +1,7 @@
#= require application
+#= require jasminerice_reporter
#= require mock-ajax
-#= require_tree .
+#= require_tree .
+
+window.peopleJson = ""
+window.occupationsJson = ""
Please sign in to comment.
Something went wrong with that request. Please try again.