angular_sprinkles 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57df238e22f7ad4ce3f7b31a879bb2d0bf7dd1a2
4
- data.tar.gz: b88604b89c0e190edc174892d062f93496086611
3
+ metadata.gz: f51b684a9bc158c109028e925728b7f7ea11ef7d
4
+ data.tar.gz: 46cd826a0e658158aa1f8dfb4ef2f46b1796a4b8
5
5
  SHA512:
6
- metadata.gz: 9cf3e67d310c5b8b508e07d72b10c4a063f27e9d721396b181e943eb527553c13daa45b7963fb2eb10224f15ac5f4b6560224f1ffccaf1fd40c316b5a3d2adbc
7
- data.tar.gz: a10d69a9029a35b696eaa50a619f4a6bdc3b887e7a19ab24b66d89b79dcf89dc24c08359949ef9b1884d84840019babb156955541a788091dc8cbc4349cb36c1
6
+ metadata.gz: 43638b8a5a26c7b51710e305002bcbc63fc8ce59153b6971c6b49fef723627fd7b4bca8b1f16712472f5e1fa90fc5f4fc8ae24a2d98f8498d621e81b042c324b
7
+ data.tar.gz: 79ef81a80c26637a54d318ee9987151afd232add27c672a08f4d2239146d968756566526c81acad767a42d42e3e5f9a079d3cb0971cd5295c7456df5c9049c9c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: angular_sprinkles 0.2.8 ruby lib
5
+ # stub: angular_sprinkles 0.2.9 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "angular_sprinkles"
9
- s.version = "0.2.8"
9
+ s.version = "0.2.9"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -11,16 +11,17 @@ module AngularSprinkles
11
11
  # the object and the Angular representation of the form.
12
12
  def bind_form_for(record, submit_callback, options = {}, &block)
13
13
  form_name = ObjectKeyWrapper.new('form', JavaScript::NoOp)
14
- record_array = [record].flatten # ensures that record will be handled in the same way whether or not it's an array
14
+
15
+ record = [record] if !record.is_a?(Array) # ensures that record will be handled in the same way whether or not it's an array
15
16
 
16
17
  html_options = {
17
18
  'name' => form_name,
18
- 'ng-submit' => service(submit_callback, *record_array.map(&:bind), form_name)
19
+ 'ng-submit' => service(submit_callback, *record.map(&:bind), form_name)
19
20
  }.merge(options[:html] || {})
20
21
 
21
22
  augmented_options = options.merge(url: "", method: "", html: html_options)
22
23
 
23
- form_for(record_array.first, augmented_options, &block).gsub('action="" ', '').html_safe
24
+ form_for(record.first, augmented_options, &block).gsub('action="" ', '').html_safe
24
25
  end
25
26
  end
26
27
  end
@@ -3,7 +3,10 @@ class TestController < ApplicationController
3
3
 
4
4
  def javascript_bindings; end
5
5
  def form_helpers; end
6
- def bind_form_for_helper; end
6
+
7
+ def bind_form_for_helper
8
+ @models = bindable([@model])
9
+ end
7
10
 
8
11
  def set_model
9
12
  @model = bindable(TestModel.new(name: params[:name]))
@@ -3,7 +3,10 @@
3
3
  <% end %>
4
4
 
5
5
  <%# test that this works %>
6
- <%= bind_form_for [@model, @model], :form_submitted do |f| %>
6
+ <%= bind_form_for [@model, @models], :form_submitted do |f| %>
7
+ <% end %>
8
+
9
+ <%= bind_form_for @models, :form_submitted do |f| %>
7
10
  <% end %>
8
11
 
9
12
  <div ng-bind="<%= @model.bind(:life) %>"></div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular_sprinkles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabe Scholz