Module: TranslationClient::ApplicationHelper

Defined in:
app/helpers/translation_client/application_helper.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/translation_client/application_helper.rb', line 3

def method_missing(m, *args, &block)
  if m.to_s.match(/i18n_backend_active_record_translation/) && m.to_s.match(/path|url/)
    translation_client.send m.to_s.gsub('i18n_backend_active_record_translation', 'translation'), *args, &block
  elsif m.to_s.match(/path|url/) && main_app.respond_to?(m)
    main_app.send m, *args, &block
  else
    super m, *args, &block
  end
end