module Sequel::Plugins::FormeI18n::SequelFormI18n

  1. lib/sequel/plugins/forme_i18n.rb

Methods

Public Instance

  1. subform

Public Instance methods

subform (association, opts={}, &block)

Checks if there's a translation for the 'models.<table_name>.<association>' key and merge it to the options with the :legend key

Calls the original Sequel::Plugins::Forme::SequelForm method

[show source]
   # File lib/sequel/plugins/forme_i18n.rb
14 def subform(association, opts={}, &block)
15   i18n_key = "models.#{obj.class.table_name}.#{association}"
16 
17   if opts[:legend].nil? && I18n.exists?(i18n_key)
18     opts[:legend] = I18n.t(i18n_key)
19   end
20 
21   super
22 end