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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f51b684a9bc158c109028e925728b7f7ea11ef7d
|
4
|
+
data.tar.gz: 46cd826a0e658158aa1f8dfb4ef2f46b1796a4b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43638b8a5a26c7b51710e305002bcbc63fc8ce59153b6971c6b49fef723627fd7b4bca8b1f16712472f5e1fa90fc5f4fc8ae24a2d98f8498d621e81b042c324b
|
7
|
+
data.tar.gz: 79ef81a80c26637a54d318ee9987151afd232add27c672a08f4d2239146d968756566526c81acad767a42d42e3e5f9a079d3cb0971cd5295c7456df5c9049c9c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.9
|
data/angular_sprinkles.gemspec
CHANGED
@@ -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.
|
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.
|
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
|
-
|
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, *
|
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(
|
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
|
-
|
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, @
|
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>
|