vue-form-for 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 141a5e932e4ee1bbe1e69e52640428b0204c51bd
4
+ data.tar.gz: 39695da0d14cd099694f0806e91c266347d64862
5
+ SHA512:
6
+ metadata.gz: 042d7b803638e3d24b06ee0c1dc3457f12f1903caaaa522468846d5b3a7a163711a1daf0b97e7132423f69b432dc09804b1fff4ba3fc48dd6aded3a6bbbaae63
7
+ data.tar.gz: dda89dbfc4aed523577d97afe2034b64828d6c0b792188283f47f6fc0ec4b90b7fdfd144c759aef0f6c367b6d77e20729f0d11c5789f0879c7c0628d03a9b8fc
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # CHANGELOG - vue-form-for
2
+
3
+ ## 0.1.0 (2017-04-05)
4
+
5
+ * The first release with minimum functionalities.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2017 Tsutomu Kuroda
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ vue-form-for
2
+ ============
3
+
4
+ A custom Rails form builder for Vue.js
@@ -0,0 +1,2 @@
1
+ require 'vue-form-for/form_builder'
2
+ require 'vue-form-for/railtie' if defined?(Rails)
@@ -0,0 +1,12 @@
1
+ module VueFormFor
2
+ class FormBuilder < ActionView::Helpers::FormBuilder
3
+ (field_helpers - [:label, :fields_for]).each do |selector|
4
+ class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
5
+ def #{selector}(method, options = {})
6
+ options[:"v-model"] ||= "\#{@object_name}.\#{method}"
7
+ super(method, options)
8
+ end
9
+ RUBY_EVAL
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ module VueFormFor
2
+ module FormHelpers
3
+ def vue_form_for(record, options = {}, &block)
4
+ options[:builder] ||= VueFormFor::FormBuilder
5
+ form_for(record, options, &block)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,11 @@
1
+ require 'vue-form-for/form_helpers'
2
+
3
+ module VueFormFor
4
+ class Railtie < Rails::Railtie
5
+ initializer "vue-form-for.view_form_helpers" do
6
+ ActiveSupport.on_load :action_view do
7
+ include VueFormFor::FormHelpers
8
+ end
9
+ end
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,50 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vue-form-for
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Tsutomu KURODA
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A custom Rails form builder for Vue.js
14
+ email: t-kuroda@oiax.jp
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - CHANGELOG.md
20
+ - MIT-LICENSE
21
+ - README.md
22
+ - lib/vue-form-for.rb
23
+ - lib/vue-form-for/form_builder.rb
24
+ - lib/vue-form-for/form_helpers.rb
25
+ - lib/vue-form-for/railtie.rb
26
+ homepage: https://github.com/kuroda/vue-form-for
27
+ licenses:
28
+ - MIT
29
+ metadata: {}
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: 2.2.2
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubyforge_project:
46
+ rubygems_version: 2.5.2
47
+ signing_key:
48
+ specification_version: 4
49
+ summary: A custom Rails form builder for Vue.js
50
+ test_files: []