lib/alephant/views/base.rb in alephant-renderer-0.0.6 vs lib/alephant/views/base.rb in alephant-renderer-0.0.7

- old
+ new

@@ -12,19 +12,13 @@ def initialize(data = {}) @data = Hashie::Mash.new data end - def t(*args) + def t(key, params = {}) I18n.locale = self.class::LOCALE - lambda do |comma_delimited_args| - args = comma_delimited_args.strip.split ',' - key = args.shift - params = args.empty? ? {} : JSON.parse(args.first).with_indifferent_access - prefix = /\/([^\/]+)\./.match(template_file)[1] - - I18n.translate("#{prefix}.#{key}", params) - end + prefix = /\/([^\/]+)\./.match(template_file)[1] + I18n.translate("#{prefix}.#{key}", params) end def self.inherited(subclass) ::Alephant::Views.register(subclass) end