preciousss 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -42,7 +42,7 @@ module Preciousss
|
|
42
42
|
|
43
43
|
unless object_errors.empty?
|
44
44
|
options[:class] ||= 'errors'
|
45
|
-
options[:id] ||= objects.map{|object| object.class.name.underscore}.join('
|
45
|
+
options[:id] ||= objects.map{|object| object.class.name.underscore}.join('_') + '_errors'
|
46
46
|
options[:title] = I18n.t('activerecord.errors.template.header', :model => objects.map{|object| object.class.human}.to_sentence, :count => object_errors.size) if options[:title] === true
|
47
47
|
|
48
48
|
I18n.with_options :locale => options[:locale], :scope => [:activerecord, :errors, :template] do |locale|
|
@@ -58,7 +58,7 @@ module Preciousss
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
|
61
|
+
protected ######################################################################################################
|
62
62
|
|
63
63
|
# Get locale from top-level domain or return nil if such locale is not available
|
64
64
|
# You have to put something like:
|
data/lib/preciousss/version.rb
CHANGED
@@ -3,19 +3,19 @@ module Preciousss
|
|
3
3
|
module ActionView
|
4
4
|
|
5
5
|
def body_class
|
6
|
-
qualified_controller_name = controller.controller_path.gsub('/', '
|
7
|
-
"#{qualified_controller_name} #{controller.action_name} #{qualified_controller_name}
|
6
|
+
qualified_controller_name = controller.controller_path.gsub('/', '_')
|
7
|
+
"#{qualified_controller_name} #{controller.action_name} #{qualified_controller_name}_#{controller.action_name} #{I18n.locale}"
|
8
8
|
end
|
9
9
|
|
10
10
|
def body_id
|
11
|
-
"#{controller.controller_path.gsub('/', '
|
11
|
+
"#{controller.controller_path.gsub('/', '_')}_body"
|
12
12
|
end
|
13
13
|
|
14
14
|
def flash_messages
|
15
15
|
return if flash.blank?
|
16
16
|
|
17
|
-
content_tag(:div, :class => "
|
18
|
-
flash.map{|key, value| content_tag(:p, content_tag(:span, value), :class => "
|
17
|
+
content_tag(:div, :class => "flash_messages #{flash.keys.map{|key| "with_#{key}"}.join(' ')}") do
|
18
|
+
flash.map{|key, value| content_tag(:p, content_tag(:span, value), :class => "flash_#{key}")}.join.html_safe
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: preciousss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- sodercober
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-31 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|