lib/administrate/field/globalize/string.rb in administrate-field-globalize-string-0.0.1.alpha1 vs lib/administrate/field/globalize/string.rb in administrate-field-globalize-string-0.0.1.alpha3
- old
+ new
@@ -7,11 +7,13 @@
class String < Administrate::Field::Base
class Engine < ::Rails::Engine
end
def self.permitted_attribute(attr, _options = nil)
- I18n.available_locales.map { |locale| "#{attr}_#{locale.downcase}" }
+ I18n.available_locales.map do |locale|
+ "#{attr}_#{locale}".downcase.underscore
+ end
end
def truncate
data.to_s[0...truncation_length]
end
@@ -20,9 +22,13 @@
true
end
def self.translation?
true
+ end
+
+ def to_partial_path
+ "/fields/globalize/string/#{page}"
end
private
def truncation_length