Module: Wallaby::ApplicationHelper

Includes:
Configurable, ConfigurationHelper, Engineable, Urlable
Included in:
ResourcesHelper
Defined in:
lib/helpers/wallaby/application_helper.rb

Overview

Wallaby application helper

Instance Method Summary collapse

Methods included from Urlable

#edit_path, #index_path, #new_path, #show_path, #url_for

Methods included from Engineable

#current_engine, #current_engine_name, #current_engine_route, #script_name

Methods included from Configurable

#wallaby_controller

Methods included from ConfigurationHelper

#configuration, #default_metadata, #features, #mapping, #models, #pagination, #security, #sorting

Instance Method Details

#form_for(record, options = {}, &block) ⇒ Object

Override original #form_for method to provide default form builder

Parameters:

  • record (ActiveRecord::Base, String, Symbol)
  • options (Hash) (defaults to: {})


14
15
16
17
# File 'lib/helpers/wallaby/application_helper.rb', line 14

def form_for(record, options = {}, &block)
  options[:builder] ||= FormBuilder
  super
end

#wt(key, options = {}) ⇒ String

I18n transaltion just for Wallaby

Parameters:

  • key
  • options (Hash) (defaults to: {})

Returns:

  • (String)

    transaltion for given key



23
24
25
# File 'lib/helpers/wallaby/application_helper.rb', line 23

def wt(key, options = {})
  Locale.t key, { translator: method(:t) }.merge(options)
end