awesome_form_attributes 0.0.1

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
+ data.tar.gz: 776b1caaa304e6762cfb7d538fe0132021130ee0
4
+ metadata.gz: a69f2eed39b248a8c28a8573d0edafeacd9d56da
5
+ SHA512:
6
+ data.tar.gz: 19891e150d2bc8ff23e67d2f16a170fc9b32d188f13735634c856e3c50c86db3a84d79e1dda41315ac6bd8df335605009cb1e91f3cd5bd84d50a183b72ca4011
7
+ metadata.gz: 543b4320186d9515bcc2e874721a44f5b9ecd30163f7ae63aecdad0ba8c21ba818f00357a8919c1cfb642308db492d3bcc52f2b914495f801a5a6b41df22dbff
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ /*.gem
data/README.md ADDED
@@ -0,0 +1,11 @@
1
+ AwesomeFormAttributes
2
+ =====
3
+
4
+
5
+ install
6
+ ----------
7
+ gem install awesome_form_attributes
8
+
9
+
10
+
11
+
@@ -0,0 +1,15 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'awesome_form_attributes'
5
+ s.version = '0.0.1'
6
+ s.authors = ['Zhimeng Sun']
7
+ s.email = ['zhimengSun@gmail.com']
8
+ s.homepage = 'https://github.com/zhimengSun/awesome_form_attributes'
9
+ s.summary = 'Easy way to write attributes for DB based Object'
10
+ s.description = 'Easy way to write attributes for DB based Object in the VIEWS'
11
+
12
+ s.files = `git ls-files`.split("\n")
13
+
14
+ s.add_dependency "rails"
15
+ end
@@ -0,0 +1,11 @@
1
+ module ActionView
2
+ module Helpers
3
+ def boolean_collection
4
+ [["是", 1], ["否", 0]]
5
+ end
6
+
7
+ def localize_attr(sym, otps = {})
8
+ I18n.t("activerecord.attributes.#{controller_name.singularize}.#{sym.to_s}")
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ class << ActiveRecord::Base
2
+ def awesome_form_attributs(opts = {})
3
+ end
4
+ end
5
+
6
+
@@ -0,0 +1,15 @@
1
+ module UsedAttrColumns
2
+
3
+ extend ActiveSupport::Concern
4
+
5
+ module ClassMethods
6
+ end
7
+
8
+ def used_attrs
9
+ I18n.t("activerecord.attributes.#{self.class.table_name.singularize}").keys
10
+ end
11
+
12
+ def short_used_attrs
13
+ []
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ module AwesomeFormAttributes
2
+ def self.version
3
+ "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ require "rails"
2
+ require "awesome_form_attributes/helpers"
3
+ require "awesome_form_attributes/used_attr_columns"
4
+
5
+ ActiveRecord::Base.send :include, UsedAttrColumns
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: awesome_form_attributes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Zhimeng Sun
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2014-11-07 00:00:00 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ prerelease: false
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - &id002
20
+ - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ type: :runtime
24
+ version_requirements: *id001
25
+ description: Easy way to write attributes for DB based Object in the VIEWS
26
+ email:
27
+ - zhimengSun@gmail.com
28
+ executables: []
29
+
30
+ extensions: []
31
+
32
+ extra_rdoc_files: []
33
+
34
+ files:
35
+ - .gitignore
36
+ - README.md
37
+ - awesome_form_attributes.gemspec
38
+ - lib/awesome_form_attributes.rb
39
+ - lib/awesome_form_attributes/helpers.rb
40
+ - lib/awesome_form_attributes/setting.rb
41
+ - lib/awesome_form_attributes/used_attr_columns.rb
42
+ - lib/awesome_form_attributes/version.rb
43
+ homepage: https://github.com/zhimengSun/awesome_form_attributes
44
+ licenses: []
45
+
46
+ metadata: {}
47
+
48
+ post_install_message:
49
+ rdoc_options: []
50
+
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - *id002
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - *id002
59
+ requirements: []
60
+
61
+ rubyforge_project:
62
+ rubygems_version: 2.4.2
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Easy way to write attributes for DB based Object
66
+ test_files: []
67
+