backtastic 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/README.md +10 -5
  2. data/backtastic.gemspec +4 -1
  3. data/example/.rspec +1 -0
  4. data/example/Gemfile +8 -1
  5. data/example/app/assets/javascripts/backbone/example.js.coffee +1 -0
  6. data/example/app/assets/javascripts/backbone/models/people.coffee +4 -0
  7. data/example/app/assets/javascripts/backbone/rails_metadata.coffee.erb +3 -0
  8. data/example/app/assets/javascripts/backbone/views/edit_person_view.coffee +1 -1
  9. data/example/app/assets/templates/edit_person_view_template.jst.hamlc +1 -0
  10. data/example/app/models/person.rb +1 -1
  11. data/example/db/migrate/20120605190808_add_evil_to_people.rb +5 -0
  12. data/example/db/schema.rb +2 -1
  13. data/example/spec/backtastic_spec.rb +6 -0
  14. data/example/spec/javascripts/models/person_spec.coffee +27 -0
  15. data/example/spec/javascripts/util/module_spec.coffee +16 -0
  16. data/example/spec/javascripts/views/check_box_view_spec.coffee +27 -0
  17. data/example/spec/javascripts/views/edit_person_view_spec.coffee +3 -2
  18. data/example/spec/spec_helper.rb +33 -0
  19. data/lib/assets/javascripts/backbone_wrap_errors.coffee +10 -0
  20. data/lib/assets/javascripts/backtastic.coffee +2 -0
  21. data/lib/assets/javascripts/templates/check_box_template.jst.hamlc +2 -0
  22. data/lib/assets/javascripts/util/module.coffee +12 -0
  23. data/lib/assets/javascripts/util/validation.coffee +39 -0
  24. data/lib/assets/javascripts/views/check_box_view.coffee +8 -0
  25. data/lib/assets/javascripts/views/form_field_view.coffee +7 -3
  26. data/lib/assets/javascripts/views/form_helpers.coffee +18 -0
  27. data/lib/assets/javascripts/views/form_view.coffee +8 -35
  28. data/lib/backtastic.rb +9 -0
  29. data/lib/backtastic/version.rb +1 -1
  30. metadata +57 -10
data/README.md CHANGED
@@ -6,10 +6,9 @@ Think formtastic meets backbone with some twitter bootstrap goodness.
6
6
  At Gaslight we've built several rails apps with backbone and one of the more common complaints from new developers to this stuff is the lack of form helpery goodness that rails gives you. This is our attempt to start filling this gap. Most of the action right now happens in `Backtastic.Views.FormView`. This view is designed to be as a superclass within your application and give you several bits of goodness:
7
7
 
8
8
  * helpers to generate a form fields with twitter bootstrap compatible markup. So far textField, selectField, dateField
9
- * save implementation which does the following
10
- * settings attributes for each form field on the model
11
- * saves the model and listens for errors
12
- * parses validation errors from rails and displays errors on individual fields
9
+ * default save implementation that updates the model from the form and persists
10
+ * handling validation errors from rails and displaying errors on individual fields
11
+ * composite views
13
12
 
14
13
  Usage
15
14
  -----
@@ -33,6 +32,13 @@ Backtastic provides a render method that will invoke your template with the view
33
32
  %form
34
33
  = @textField(label: "Name", field: "Name")
35
34
 
35
+ The field helper method (`@textField()` in this example) creates a subview of the appropriate type which renders a label and form input using twitter bootstrap friendly markup. They also listen to the model for validation errors and display appropriate styling and error messages.
36
+
37
+ Validation
38
+ ----------
39
+
40
+ Rails validation on the server side will be handled appropriately by the form element views. You can also add client side validation. So far we support presence and format, checkout the Person backbone model in the example app to see how it works. We'll be adding support for reflecting on the rails model adding client side validations to the backbone model "real soon now".
41
+
36
42
  Example App
37
43
  -----------
38
44
 
@@ -58,7 +64,6 @@ I'd like to have some metadata generated form rails and available to backbone so
58
64
 
59
65
  @form fields["first_name", "last_name"]
60
66
 
61
- Also, it seems like making client side validation happen when appropriate would be nice. And I'd like to refactor the way FormView deals with rails validation errors, sooner rather than later probably.
62
67
 
63
68
  Shameless self-promotion
64
69
  ------------------------
@@ -20,9 +20,12 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
 
22
22
  # specify any dependencies here; for example:
23
- # s.add_development_dependency "rspec"
23
+ s.add_development_dependency "rspec"
24
+ s.add_development_dependency "pry"
25
+
24
26
  s.add_runtime_dependency "haml_coffee_assets"
25
27
  s.add_runtime_dependency "rails-backbone"
26
28
  s.add_runtime_dependency "inflection-js-rails"
27
29
  s.add_runtime_dependency "twitter-bootstrap-rails"
30
+ s.add_runtime_dependency "activesupport"
28
31
  end
@@ -0,0 +1 @@
1
+ --colour
@@ -18,15 +18,22 @@ group :assets do
18
18
 
19
19
  gem "haml_coffee_assets"
20
20
  gem "jasmine-ajax"
21
- gem "jasminerice-runner"
21
+ gem "jasminerice-runner"
22
22
  gem "backtastic", :path => ".."
23
23
  gem 'uglifier', '>= 1.0.3'
24
24
  end
25
25
 
26
+ group :development, :test do
27
+ gem "pry"
28
+ end
29
+
26
30
  gem 'jquery-rails'
27
31
  gem "jasminerice"
28
32
  gem "capybara-webkit"
29
33
 
34
+ gem "rspec-rails"
35
+ gem "rspec-given"
36
+
30
37
  gem "inherited_resources"
31
38
  # To use ActiveModel has_secure_password
32
39
  # gem 'bcrypt-ruby', '~> 3.0.0'
@@ -3,6 +3,7 @@
3
3
  #= require_tree ./models
4
4
  #= require_tree ./views
5
5
  #= require_tree ./routers
6
+ #= require ./rails_metadata
6
7
 
7
8
  window.Example =
8
9
  Models: {}
@@ -1,6 +1,10 @@
1
1
  class Example.Models.Person extends Backbone.Model
2
2
  urlRoot: "/people"
3
3
 
4
+ @validatePresenceOf "first_name"
5
+
6
+ @validateFormatOf "last_name", pattern: /^J.*/
7
+
4
8
  class Example.Collections.PeopleCollection extends Backbone.Collection
5
9
  model: Example.Models.Person
6
10
 
@@ -0,0 +1,3 @@
1
+ <% ActiveRecord::Base.descendants.each do |model| %>
2
+ Example.Models["<%= model.to_s %>"].schema = <%= Backtastic.schema_for(model).to_json %>
3
+ <% end %>
@@ -4,7 +4,7 @@ class Example.Views.EditPersonView extends Backtastic.Views.FormView
4
4
  constructor: (options)->
5
5
  super
6
6
  @occupations = options.occupations
7
-
7
+
8
8
  events:
9
9
  "submit form": "save"
10
10
 
@@ -6,6 +6,7 @@
6
6
  %fieldset
7
7
  = @textField(field: "first_name", label: "First Name")
8
8
  = @textField(field: "last_name", label: "Last Name")
9
+ = @checkBoxField(field: "evil", label: "Evil")
9
10
  = @dateField(field: "birth_date", label: "Birth Date", format: "yyyy-mm-dd")
10
11
  = @selectField(field: "occupation_id", label: "Occupation", collection: @occupations)
11
12
  .modal-footer
@@ -1,5 +1,5 @@
1
1
  class Person < ActiveRecord::Base
2
- validates_presence_of :first_name
2
+ # validates_presence_of :first_name
3
3
 
4
4
  belongs_to :occupation
5
5
  end
@@ -0,0 +1,5 @@
1
+ class AddEvilToPeople < ActiveRecord::Migration
2
+ def change
3
+ add_column :people, :evil, :boolean
4
+ end
5
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20120526164853) do
14
+ ActiveRecord::Schema.define(:version => 20120605190808) do
15
15
 
16
16
  create_table "occupations", :force => true do |t|
17
17
  t.string "name"
@@ -26,6 +26,7 @@ ActiveRecord::Schema.define(:version => 20120526164853) do
26
26
  t.integer "occupation_id"
27
27
  t.datetime "created_at", :null => false
28
28
  t.datetime "updated_at", :null => false
29
+ t.boolean "evil"
29
30
  end
30
31
 
31
32
  end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ describe "schema_for" do
4
+ Given(:person_schema) { Backtastic.schema_for(Person) }
5
+ Then { person_schema["first_name"]["type"].should == :string }
6
+ end
@@ -0,0 +1,27 @@
1
+ describe "Person", ->
2
+ beforeEach ->
3
+ @person = new Example.Models.Person()
4
+ describe "validation", ->
5
+ beforeEach ->
6
+ @validationErrors = {}
7
+ @person.on "error", (model, errors) =>
8
+ @validationErrors = errors
9
+ describe "failing validation", ->
10
+ beforeEach ->
11
+ @person.set first_name: "", last_name: "NotJones"
12
+ it "should not be valid", ->
13
+ expect(@person.isValid()).toBeFalsy()
14
+ it "should have triggered the error event for first name", ->
15
+ expect(@validationErrors.first_name.length).toEqual 1
16
+ it "should have triggered the error event for last name", ->
17
+ expect(@validationErrors.last_name.length).toEqual 1
18
+ describe "with valid attributes", ->
19
+ beforeEach ->
20
+ @person.set first_name: "Fred", last_name: "Jones"
21
+ it "should be valid", ->
22
+ expect(@person.isValid()).toTruthy
23
+ it "should have no errors", ->
24
+ expect(@validationErrors.first_name?).toBeFalsy()
25
+
26
+
27
+
@@ -0,0 +1,16 @@
1
+ FooModule =
2
+ bar: -> "baz"
3
+
4
+ classMethods:
5
+ wuzza: -> "howdy"
6
+
7
+ class Includee
8
+
9
+ Backtastic.include Includee, FooModule
10
+
11
+ describe "Module", ->
12
+ it "should include module methods", ->
13
+ expect(new Includee().bar()).toEqual "baz"
14
+ it "should add class methods", ->
15
+ expect(Includee.wuzza()).toEqual "howdy"
16
+
@@ -0,0 +1,27 @@
1
+ describe "check box view", ->
2
+ beforeEach ->
3
+ setFixtures "<div id='check_box_view'></div>"
4
+ @model = new Example.Models.Thing
5
+ @checkBoxFieldView = new Backtastic.Views.CheckBoxView
6
+ model: @model
7
+ field: "awesome"
8
+ label: "Awesome"
9
+ el: $("#check_box_view")
10
+ parentView: new Example.Views.FormView
11
+
12
+ describe "when the value is true", ->
13
+ beforeEach ->
14
+ @model.set awesome: true
15
+ @checkBoxFieldView.render()
16
+ it "renders a check box input", ->
17
+ expect(@checkBoxFieldView.$("input[type=checkbox]")).toExist()
18
+ it "renders a checked check box if the value is true", ->
19
+ expect(@checkBoxFieldView.$("input[type=checkbox]").attr("checked")).toEqual("checked")
20
+
21
+ describe "when value is false", ->
22
+ beforeEach ->
23
+ @model.set awesome: false
24
+ @checkBoxFieldView.render()
25
+ it "render an unchecked check box if the value is false", ->
26
+ expect(@checkBoxFieldView.$("input[type=checkbox]").attr("checked")).toBeFalsy()
27
+
@@ -14,11 +14,12 @@ describe "EditPersonView", ->
14
14
  it "renders fields", ->
15
15
  expect(@editPersonView.$("input[name='first_name']")).toExist()
16
16
  expect(@editPersonView.$("select[name='occupation_id']")).toExist()
17
+ expect(@editPersonView.$("input[name='evil'][type=checkbox]")).toExist()
17
18
  describe "saving", ->
18
19
  beforeEach ->
19
20
  jasmine.Ajax.useMock()
20
21
  @editPersonView.$("input[name='first_name']").val("Bob")
21
- @editPersonView.$("input[name='last_name']").val("Villa")
22
+ @editPersonView.$("input[name='last_name']").val("Jones")
22
23
  @editPersonView.save(new jQuery.Event)
23
24
  @request = mostRecentAjaxRequest()
24
25
  it "disables the save button", ->
@@ -27,7 +28,7 @@ describe "EditPersonView", ->
27
28
  beforeEach ->
28
29
  @request.response
29
30
  status: 422
30
- contentType: "application/json"
31
+ contentType: "application/json; charset=utf-8"
31
32
  responseText: JSON.stringify
32
33
  errors:
33
34
  first_name: ["cannot be Bob"]
@@ -0,0 +1,33 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ require File.expand_path("../../config/environment", __FILE__)
4
+ require 'rspec/rails'
5
+ require 'rspec/autorun'
6
+ require 'rspec/given'
7
+
8
+ # Requires supporting ruby files with custom matchers and macros, etc,
9
+ # in spec/support/ and its subdirectories.
10
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
11
+
12
+ RSpec.configure do |config|
13
+ # ## Mock Framework
14
+ #
15
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
16
+ #
17
+ # config.mock_with :mocha
18
+ # config.mock_with :flexmock
19
+ # config.mock_with :rr
20
+
21
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
22
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
23
+
24
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
25
+ # examples within a transaction, remove the following line or assign false
26
+ # instead of true.
27
+ config.use_transactional_fixtures = true
28
+
29
+ # If true, the base class of anonymous controllers will be inferred
30
+ # automatically. This will be the default behavior in future versions of
31
+ # rspec-rails.
32
+ config.infer_base_class_for_anonymous_controllers = false
33
+ end
@@ -0,0 +1,10 @@
1
+ Backbone.wrapError = (onError, originalModel, options) ->
2
+ (model, resp) ->
3
+ resp = if model == originalModel then resp else model
4
+ errors = if resp.getResponseHeader("Content-Type").match(/json/)
5
+ JSON.parse(resp.responseText)
6
+ else
7
+ resp
8
+ if (onError)
9
+ onError(originalModel, errors, resp, options)
10
+ originalModel.trigger('error', originalModel, errors, resp, options)
@@ -2,7 +2,9 @@
2
2
  #= require inflection
3
3
  #= require jquery.serializeObject
4
4
  #= require bootstrap-datepicker
5
+ #= require backbone_wrap_errors
5
6
  #= require_self
7
+ #= require_directory ./util
6
8
  #= require_tree .
7
9
 
8
10
  window.Backtastic = {
@@ -0,0 +1,2 @@
1
+ %label{for: @field}= @label
2
+ %input{type: "checkbox", name: @field}
@@ -0,0 +1,12 @@
1
+ moduleKeywords = ['included', 'classMethods']
2
+
3
+ Backtastic.include = (klass, obj) ->
4
+ for key, value of obj when key not in moduleKeywords
5
+ # Assign properties to the prototype
6
+ klass::[key] = value
7
+
8
+ if obj.classMethods
9
+ klass[key] = value for key, value of obj.classMethods
10
+
11
+ obj.included?.apply(klass)
12
+ this
@@ -0,0 +1,39 @@
1
+ Backtastic.Validators =
2
+
3
+ presence: (options) ->
4
+ (field, value) -> "is required" unless value?.length > 0
5
+
6
+ format: (options) ->
7
+ (field, value) -> "must match specified format." unless value?.match(options?.pattern)
8
+
9
+ Backtastic.Validation =
10
+
11
+ classMethods:
12
+
13
+ addValidator: (validator, field, options) ->
14
+ @validations or = {}
15
+ @validations[field] or= []
16
+ @validations[field].push Backtastic.Validators[validator]?(options)
17
+
18
+ validatePresenceOf: (field) ->
19
+ @addValidator("presence", field)
20
+
21
+ validateFormatOf: (field, options) ->
22
+ @addValidator("format", field, options)
23
+
24
+ addError: (field, error) ->
25
+ @errors[field] or= []
26
+ @errors[field].push error
27
+
28
+ clearErrors: -> @errors = {}
29
+
30
+ validate: (attributes) ->
31
+ @clearErrors()
32
+ return unless @constructor.validations
33
+ for attr, validators of @constructor.validations
34
+ for validator in validators
35
+ error = validator(attr, attributes[attr])
36
+ @addError(attr, error) if error
37
+ @errors if _.keys(@errors).length > 0
38
+
39
+ Backtastic.include Backbone.Model, Backtastic.Validation
@@ -0,0 +1,8 @@
1
+ #= require ./form_field_view
2
+ class Backtastic.Views.CheckBoxView extends Backtastic.Views.FormFieldView
3
+
4
+ template: JST["templates/check_box_template"]
5
+
6
+ render: ->
7
+ super
8
+ @$('input').prop("checked", "checked") if @model.get(@field)
@@ -6,6 +6,7 @@ class Backtastic.Views.FormFieldView extends Backtastic.View
6
6
  @label = options.label
7
7
  @parentView = options.parentView
8
8
  @parentView.on "rendered", => @afterParentRender()
9
+ @model.on "error", (model, errors) => @displayErrors(errors)
9
10
 
10
11
  afterParentRender: ->
11
12
  @setElement(@parentView.$("[data-view-id=#{@cid}]"))
@@ -15,9 +16,12 @@ class Backtastic.Views.FormFieldView extends Backtastic.View
15
16
  super
16
17
  @$el.addClass "control-group"
17
18
 
18
- displayErrors: (messages) ->
19
- @$el.addClass "error"
20
- @$el.append "<span class='help-inline'>#{message}</span>" for message in messages
19
+ displayErrors: (errors) ->
20
+ errors = errors.errors if errors.errors
21
+ if errors?[@field]
22
+ messages = errors[@field]
23
+ @$el.addClass "error"
24
+ @$el.append "<span class='help-inline'>#{message}</span>" for message in messages
21
25
 
22
26
  clearErrors: ->
23
27
  @$el.removeClass "error"
@@ -0,0 +1,18 @@
1
+ Backtastic.Views.FormHelpers =
2
+ fieldView: (fieldViewClass, options) ->
3
+ fieldView = new fieldViewClass _.extend options,
4
+ parentView: @
5
+ model: @model
6
+ fieldView.toHtml()
7
+
8
+ dateField: (options) ->
9
+ @fieldView(Backtastic.Views.DateFieldView, options)
10
+
11
+ textField: (options) ->
12
+ @fieldView(Backtastic.Views.TextFieldView, options)
13
+
14
+ checkBoxField: (options) ->
15
+ @fieldView(Backtastic.Views.CheckBoxView, options)
16
+
17
+ selectField: (options) ->
18
+ @fieldView(Backtastic.Views.SelectFieldView, options)
@@ -1,38 +1,11 @@
1
+ #= require ./form_helpers
1
2
  class Backtastic.Views.FormView extends Backtastic.View
2
-
3
- constructor: ->
4
- super
5
- @fieldViews = {}
6
-
7
- clearErrors: ->
8
- fieldView.clearErrors() for field, fieldView of @fieldViews
9
-
10
- displayErrors: (response)->
11
- @$("input[type='submit']").removeAttr("disabled")
12
- errors = JSON.parse(response.responseText)
13
- errors = errors.errors if errors.errors #rails does it this way
14
- for field, errorMessages of errors
15
- @fieldViews[field]?.displayErrors(errorMessages)
16
-
17
- fieldView: (fieldViewClass, options) ->
18
- fieldView = new fieldViewClass _.extend options,
19
- parentView: @
20
- model: @model
21
- @fieldViews[options.field] = fieldView
22
- fieldView.toHtml()
23
-
24
- dateField: (options) ->
25
- @fieldView(Backtastic.Views.DateFieldView, options)
26
-
27
- textField: (options) ->
28
- @fieldView(Backtastic.Views.TextFieldView, options)
29
-
30
- selectField: (options) ->
31
- @fieldView(Backtastic.Views.SelectFieldView, options)
32
-
3
+
33
4
  save: (event)->
34
- @$("input[type='submit']").attr("disabled", "disabled")
35
- @clearErrors()
36
5
  event.preventDefault()
37
- @model.on "error", (model, response) => @displayErrors(response)
38
- @model.save @$("form").serializeObject()
6
+ if @model.set @$("form").serializeObject()
7
+ @$("input[type='submit']").attr("disabled", "disabled")
8
+ @model.save {},
9
+ error: => @$("input[type='submit']").removeAttr("disabled")
10
+
11
+ Backtastic.include Backtastic.Views.FormView, Backtastic.Views.FormHelpers
@@ -2,8 +2,17 @@ require "backtastic/version"
2
2
  require 'rails-backbone'
3
3
  require "inflection-js-rails"
4
4
  require "twitter-bootstrap-rails"
5
+ require "active_support/inflections"
5
6
 
6
7
  module Backtastic
7
8
  class BacktasticEngine < Rails::Engine
8
9
  end
10
+
11
+ def self.schema_for(model)
12
+ schema = {}
13
+ model.to_s.constantize.columns.each do |col|
14
+ schema[col.name] = {"type" => col.type }
15
+ end
16
+ schema
17
+ end
9
18
  end
@@ -1,3 +1,3 @@
1
1
  module Backtastic
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backtastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,33 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-30 00:00:00.000000000 Z
12
+ date: 2012-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &70247227211360 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70247227211360
25
+ - !ruby/object:Gem::Dependency
26
+ name: pry
27
+ requirement: &70247227210000 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70247227210000
14
36
  - !ruby/object:Gem::Dependency
15
37
  name: haml_coffee_assets
16
- requirement: &70340299040540 !ruby/object:Gem::Requirement
38
+ requirement: &70247227209440 !ruby/object:Gem::Requirement
17
39
  none: false
18
40
  requirements:
19
41
  - - ! '>='
@@ -21,10 +43,10 @@ dependencies:
21
43
  version: '0'
22
44
  type: :runtime
23
45
  prerelease: false
24
- version_requirements: *70340299040540
46
+ version_requirements: *70247227209440
25
47
  - !ruby/object:Gem::Dependency
26
48
  name: rails-backbone
27
- requirement: &70340299039500 !ruby/object:Gem::Requirement
49
+ requirement: &70247227208580 !ruby/object:Gem::Requirement
28
50
  none: false
29
51
  requirements:
30
52
  - - ! '>='
@@ -32,10 +54,10 @@ dependencies:
32
54
  version: '0'
33
55
  type: :runtime
34
56
  prerelease: false
35
- version_requirements: *70340299039500
57
+ version_requirements: *70247227208580
36
58
  - !ruby/object:Gem::Dependency
37
59
  name: inflection-js-rails
38
- requirement: &70340299037740 !ruby/object:Gem::Requirement
60
+ requirement: &70247227223960 !ruby/object:Gem::Requirement
39
61
  none: false
40
62
  requirements:
41
63
  - - ! '>='
@@ -43,10 +65,21 @@ dependencies:
43
65
  version: '0'
44
66
  type: :runtime
45
67
  prerelease: false
46
- version_requirements: *70340299037740
68
+ version_requirements: *70247227223960
47
69
  - !ruby/object:Gem::Dependency
48
70
  name: twitter-bootstrap-rails
49
- requirement: &70340299036860 !ruby/object:Gem::Requirement
71
+ requirement: &70247227222820 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: *70247227222820
80
+ - !ruby/object:Gem::Dependency
81
+ name: activesupport
82
+ requirement: &70247227222140 !ruby/object:Gem::Requirement
50
83
  none: false
51
84
  requirements:
52
85
  - - ! '>='
@@ -54,7 +87,7 @@ dependencies:
54
87
  version: '0'
55
88
  type: :runtime
56
89
  prerelease: false
57
- version_requirements: *70340299036860
90
+ version_requirements: *70247227222140
58
91
  description: ! "Create backbone twitter bootstrap form views easily using helpers.
59
92
  Handle and display\n validation failures from rails.\n "
60
93
  email:
@@ -69,6 +102,7 @@ files:
69
102
  - Rakefile
70
103
  - backtastic.gemspec
71
104
  - example/.gitignore
105
+ - example/.rspec
72
106
  - example/Gemfile
73
107
  - example/README.rdoc
74
108
  - example/Rakefile
@@ -79,6 +113,7 @@ files:
79
113
  - example/app/assets/javascripts/backbone/models/occupation.coffee
80
114
  - example/app/assets/javascripts/backbone/models/people.coffee
81
115
  - example/app/assets/javascripts/backbone/models/thing.coffee
116
+ - example/app/assets/javascripts/backbone/rails_metadata.coffee.erb
82
117
  - example/app/assets/javascripts/backbone/routers/.gitkeep
83
118
  - example/app/assets/javascripts/backbone/routers/people_router.coffee
84
119
  - example/app/assets/javascripts/backbone/templates/.gitkeep
@@ -120,6 +155,7 @@ files:
120
155
  - example/config/routes.rb
121
156
  - example/db/migrate/20120429172946_create_people.rb
122
157
  - example/db/migrate/20120526164853_create_occupations.rb
158
+ - example/db/migrate/20120605190808_add_evil_to_people.rb
123
159
  - example/db/schema.rb
124
160
  - example/db/seeds.rb
125
161
  - example/doc/README_FOR_APP
@@ -133,20 +169,31 @@ files:
133
169
  - example/public/index.html
134
170
  - example/public/robots.txt
135
171
  - example/script/rails
172
+ - example/spec/backtastic_spec.rb
173
+ - example/spec/javascripts/models/person_spec.coffee
136
174
  - example/spec/javascripts/spec.js.coffee
175
+ - example/spec/javascripts/util/module_spec.coffee
176
+ - example/spec/javascripts/views/check_box_view_spec.coffee
137
177
  - example/spec/javascripts/views/edit_person_view_spec.coffee
138
178
  - example/spec/javascripts/views/example_form_view_spec.coffee
139
179
  - example/spec/javascripts/views/select_field_view_spec.coffee
140
180
  - example/spec/javascripts/views/text_field_view_spec.coffee
181
+ - example/spec/spec_helper.rb
141
182
  - example/vendor/assets/javascripts/.gitkeep
142
183
  - example/vendor/assets/stylesheets/.gitkeep
143
184
  - example/vendor/plugins/.gitkeep
185
+ - lib/assets/javascripts/backbone_wrap_errors.coffee
144
186
  - lib/assets/javascripts/backtastic.coffee
187
+ - lib/assets/javascripts/templates/check_box_template.jst.hamlc
145
188
  - lib/assets/javascripts/templates/select_field_template.jst.hamlc
146
189
  - lib/assets/javascripts/templates/text_field_template.jst.hamlc
190
+ - lib/assets/javascripts/util/module.coffee
191
+ - lib/assets/javascripts/util/validation.coffee
147
192
  - lib/assets/javascripts/views/backtastic_view.coffee
193
+ - lib/assets/javascripts/views/check_box_view.coffee
148
194
  - lib/assets/javascripts/views/date_field_view.coffee
149
195
  - lib/assets/javascripts/views/form_field_view.coffee
196
+ - lib/assets/javascripts/views/form_helpers.coffee
150
197
  - lib/assets/javascripts/views/form_view.coffee
151
198
  - lib/assets/javascripts/views/select_field_view.coffee
152
199
  - lib/assets/javascripts/views/text_field_view.coffee