Module: Dragoman::Mapper::Mapping

Defined in:
lib/dragoman/mapper.rb

Instance Method Summary collapse

Instance Method Details

#build_with_localization(scope, set, path, as, options) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/dragoman/mapper.rb', line 5

def build_with_localization scope, set, path, as, options
  if options[:locale]
    Dragoman::UrlHelpers.add_untranslated_helpers as, set.named_routes.path_helpers_module, set.named_routes.url_helpers_module if as
    as = "#{as}_#{options[:locale]}" if as.present?
    as = nil if as && set.named_routes.routes[as.to_sym] # TODO: why do we need to set as to nil?
  end
  build_without_localization scope, set, path, as, options
end