Sha256: bf552fffb2b949a6ccb44f842582f82cd37f520f2c65ee275e958bd724f644c6
Contents?: true
Size: 941 Bytes
Versions: 16
Compression:
Stored size: 941 Bytes
Contents
module JqueryUiForm module Helpers module LabelHelper # include ActionView::Helpers::FormHelper def label(method, text = nil, options = {}) text, options = label_text(method, text, options) super(method,"#{text}:".html_safe, options) end def label_text(method, text, options={}) if text.is_a?(Hash) options.merge!(text) text = nil end text = options.delete(:label) if text.blank? if text.blank? if use_i18n text = I18n.t("#{@object_name.to_s.downcase}.#{method.to_s.downcase}",:scope => [:activerecord, :attributes]) else text = method.to_s.humanize end end if options.delete(:required) text << (required_string.is_a?(Proc) ? required_string.call : required_string) end [text, options] end end end end
Version data entries
16 entries across 16 versions & 1 rubygems