Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added alias methods

  • Loading branch information...
commit 74e6fb9e7c6c804de3c363a4675fb4d52c0ada04 1 parent d88527a
@plabaj plabaj authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/localized_language_select.rb
View
4 lib/localized_language_select.rb
@@ -68,6 +68,7 @@ def localized_language_select(object, method, priority_languages = nil, options
InstanceTag.new(object, method, self, options.delete(:object)).
to_localized_language_select_tag(priority_languages, options, html_options)
end
+ alias_method :language_select, :localized_language_select
# Return "named" select and option tags according to given arguments.
# Use +selected_value+ for setting initial value
@@ -78,6 +79,7 @@ def localized_language_select_tag(name, selected_value = nil, priority_languages
localized_language_options_for_select(selected_value, priority_languages),
{ "name" => name, "id" => name }.update(html_options.stringify_keys)
end
+ alias_method :language_select_tag, :localized_language_select_tag
# Returns a string of option tags for languages according to locale. Supply the language code in lower-case ('en', 'de')
# as +selected+ to have it marked as the selected option tag.
@@ -90,6 +92,7 @@ def localized_language_options_for_select(selected = nil, priority_languages = n
end
return language_options + options_for_select(LocalizedLanguageSelect::localized_languages_array(options), selected)
end
+ alias_method :language_options_for_select, :localized_language_options_for_select
end
@@ -111,6 +114,7 @@ class FormBuilder
def localized_language_select(method, priority_languages = nil, options = {}, html_options = {})
@template.localized_language_select(@object_name, method, priority_languages, options.merge(:object => @object), html_options)
end
+ alias_method :language_select, :localized_language_select
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.