i18n_rails_helpers 2.0.0.beta0 → 2.0.0.beta1

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: 2b72f7c802db6f9e8ff6f89f525781a2e1f8150b
4
+ data.tar.gz: ef6fb72318cd7db4ce4a615fc239e0b809236706
5
+ SHA512:
6
+ metadata.gz: cdbcd138154d3852a1cd51003d1372f304f6131531f864b478321f8ab2e1f57a1c4269a7fe426ee9649333189fd59499b33e41879d4ce84da4ba79c10e45ae6b
7
+ data.tar.gz: 8befced0d8fad7d58c2802ff1b8ea1fc8c57cd05ee4c3641072bc2d3080543f8853c9c9f0377657d18dfa76e77a83b42e791f593a3c4f66e0996d9455caebd22
@@ -1,9 +1,11 @@
1
- require 'boot_form_builder'
2
-
3
1
  module BootstrapHelper
4
- def boot_form_for(object, *args, &block)
5
- options = args.extract_options!
6
- simple_form_for(object, *(args << options.merge(builder: BootFormBuilder)), &block)
2
+ if defined?(SimpleForm)
3
+ require 'boot_form_builder'
4
+
5
+ def boot_form_for(object, *args, &block)
6
+ options = args.extract_options!
7
+ simple_form_for(object, *(args << options.merge(builder: BootFormBuilder)), &block)
8
+ end
7
9
  end
8
10
 
9
11
  def boot_page_title(action_or_title = nil, model = nil, &block)
@@ -144,7 +144,7 @@ module ContextualLinkHelpers
144
144
  content = contextual_links_for(action, resource_or_model, options)
145
145
  if block_given?
146
146
  additional_content = capture(&block)
147
- content += ("\n" + additional_content).html_safe
147
+ content += ("\n" + additional_content).html_safe unless additional_content.nil?
148
148
  end
149
149
  content
150
150
  end
@@ -37,7 +37,11 @@ module I18nHelpers
37
37
  # t_model => 'Konto' # when called in patients_controller views
38
38
  #
39
39
  def t_model(model = nil)
40
- if model.is_a? Class
40
+ if model.is_a? ActiveModel::Naming
41
+ return model.model_name.human
42
+ elsif model.class.is_a? ActiveModel::Naming
43
+ return model.class.model_name.human
44
+ elsif model.is_a? Class
41
45
  model_name = model.name.underscore
42
46
  elsif model.nil?
43
47
  model_name = controller_name.singularize
@@ -1,3 +1,3 @@
1
1
  module I18nRailsHelpers
2
- VERSION = "2.0.0.beta0"
2
+ VERSION = "2.0.0.beta1"
3
3
  end
metadata CHANGED
@@ -1,94 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_rails_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta0
5
- prerelease: 6
4
+ version: 2.0.0.beta1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Simon Huerlimann (CyT)
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-07-06 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>'
17
+ - - ">"
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.0.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>'
24
+ - - ">"
28
25
  - !ruby/object:Gem::Version
29
26
  version: 3.0.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: sqlite3
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec-rails
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: capybara
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: factory_girl_rails
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  description: Rails i18n view helpers for things like crud actions, models and and
@@ -99,49 +88,47 @@ executables: []
99
88
  extensions: []
100
89
  extra_rdoc_files: []
101
90
  files:
102
- - app/views/application/show.html.haml
103
- - app/views/application/new.html.haml
104
- - app/views/application/_list.html.haml
105
- - app/views/application/edit.html.haml
106
- - app/views/application/index.html.haml
91
+ - MIT-LICENSE
92
+ - README.md
93
+ - Rakefile
94
+ - app/assets/stylesheets/i18n_rails_helpers.scss
107
95
  - app/helpers/bootstrap_helper.rb
108
- - app/helpers/i18n_helpers.rb
109
96
  - app/helpers/contextual_link_helpers.rb
97
+ - app/helpers/i18n_helpers.rb
110
98
  - app/helpers/list_link_helpers.rb
111
- - app/assets/stylesheets/i18n_rails_helpers.scss
112
- - config/locales/en.yml
99
+ - app/views/application/_list.html.haml
100
+ - app/views/application/edit.html.haml
101
+ - app/views/application/index.html.haml
102
+ - app/views/application/new.html.haml
103
+ - app/views/application/show.html.haml
113
104
  - config/locales/de.yml
105
+ - config/locales/en.yml
106
+ - lib/boot_form_builder.rb
114
107
  - lib/i18n_rails_helpers.rb
115
108
  - lib/i18n_rails_helpers/engine.rb
116
109
  - lib/i18n_rails_helpers/version.rb
117
- - lib/boot_form_builder.rb
118
- - MIT-LICENSE
119
- - Rakefile
120
- - README.md
121
110
  homepage: https://github.com/huerlisi/i18n_rails_helpers
122
111
  licenses:
123
112
  - MIT
113
+ metadata: {}
124
114
  post_install_message:
125
115
  rdoc_options: []
126
116
  require_paths:
127
117
  - lib
128
118
  required_ruby_version: !ruby/object:Gem::Requirement
129
- none: false
130
119
  requirements:
131
- - - ! '>='
120
+ - - ">="
132
121
  - !ruby/object:Gem::Version
133
122
  version: '0'
134
123
  required_rubygems_version: !ruby/object:Gem::Requirement
135
- none: false
136
124
  requirements:
137
- - - ! '>'
125
+ - - ">"
138
126
  - !ruby/object:Gem::Version
139
127
  version: 1.3.1
140
128
  requirements: []
141
129
  rubyforge_project:
142
- rubygems_version: 1.8.23
130
+ rubygems_version: 2.2.2
143
131
  signing_key:
144
- specification_version: 3
132
+ specification_version: 4
145
133
  summary: I18n Rails helpers
146
134
  test_files: []
147
- has_rdoc: