module UiBibz::Helpers::UtilsHelper

Public Instance Methods

ui_form_for(object, *args, &block) click to toggle source
# File lib/ui_bibz/helpers/utils_helper.rb, line 10
def ui_form_for(object, *args, &block)
  options = args.extract_options!
  simple_form_for(object, *(args << new_options(options)), &block)
end
ui_translatize(translation, options) click to toggle source

Same method like I18n.translate but accept strings in default argument

# File lib/ui_bibz/helpers/utils_helper.rb, line 6
def ui_translatize(translation, options)
  UiBibz::Utils::Internationalization.new(translation, options).translate
end

Private Instance Methods

new_options(options) click to toggle source
# File lib/ui_bibz/helpers/utils_helper.rb, line 17
def new_options(options)
  if options[:html].nil?
    options[:html] = { class: options[:class] }
  elsif options[:html][:class].nil?
    options[:html] = options[:html].merge({ class: options[:class] })
  else
    options[:html][:class] = options[:html][:class] + (options[:class] || '')
  end
  options.merge(builder: UiBibzForm::UiBibzFormBuilder)
end