Module: Phlex::Rails::Helpers

Defined in:
lib/phlex/rails/helpers/routes.rb,
lib/phlex/rails/helpers.rb

Overview

An adapter for Rails routing helpers, such as article_path.

Defined Under Namespace

Modules: ActionCableMetaTag, ActionName, AssetPath, AssetURL, AudioPath, AudioTag, AudioURL, AutoDiscoveryLinkTag, BuildTagValues, ButtonTag, ButtonTo, CSPMetaTag, CSRFMetaTags, CheckBox, CheckBoxTag, ClassNames, CollectionCheckBoxes, CollectionRadioButtons, CollectionSelect, ColorField, ColorFieldTag, ComputeAssetExtname, ComputeAssetHost, ComputeAssetPath, ContentFor, ContentTag, ControllerName, ControllerPath, CurrentCycle, CurrentPage, Cycle, DOMClass, DOMID, DateField, DateFieldTag, DateSelect, DatetimeField, DatetimeFieldTag, DatetimeLocalField, DatetimeLocalFieldTag, DatetimeSelect, Debug, DefaultURLOptions, DistanceOfTimeInWords, DistanceOfTimeInWordsToNow, EmailField, EmailFieldTag, ErrorMessage, ErrorWrapping, EscapeOnce, Excerpt, FaviconLinkTag, FieldID, FieldName, FieldSetTag, Fields, FieldsFor, FileField, FileFieldTag, Flash, FontPath, FontURL, FormFor, FormTag, FormWith, GroupedCollectionSelect, GroupedOptionsForSelect, HiddenField, HiddenFieldTag, Highlight, ImagePath, ImageSubmitTag, ImageTag, ImageURL, JavascriptImportModuleTag, JavascriptImportmapTags, JavascriptIncludeTag, JavascriptPath, JavascriptTag, JavascriptURL, L, Label, LabelTag, LinkTo, LinkToIf, LinkToUnless, LinkToUnlessCurrent, Localize, MailTo, MonthField, MonthFieldTag, NumberField, NumberFieldTag, NumberToCurrency, NumberToHuman, NumberToHumanSize, NumberToPercentage, NumberToPhone, NumberWithDelimiter, NumberWithPrecision, Object, OptionGroupsFromCollectionForSelect, OptionsForSelect, OptionsFromCollectionForSelect, PasswordField, PasswordFieldTag, PathToAsset, PathToAudio, PathToFont, PathToImage, PathToJavascript, PathToStylesheet, PathToVideo, PhoneField, PhoneFieldTag, PhoneTo, Pluralize, PreloadLinkTag, Provide, PublicComputeAssetPath, RadioButton, RadioButtonTag, RangeField, RangeFieldTag, Request, ResetCycle, RichTextArea, Routes, SMSTo, Sanitize, SanitizeCSS, SearchField, SearchFieldTag, Select, SelectDate, SelectDatetime, SelectDay, SelectHour, SelectMinute, SelectMonth, SelectSecond, SelectTag, SelectTime, SelectYear, SimpleFormat, StripLinks, StripTags, StylesheetLinkTag, StylesheetPath, StylesheetURL, SubmitTag, Tag, TelephoneField, TelephoneFieldTag, TextArea, TextAreaTag, TextField, TextFieldTag, TimeAgoInWords, TimeField, TimeFieldTag, TimeSelect, TimeTag, TimeZoneOptionsForSelect, TimeZoneSelect, TokenList, Translate, Truncate, TurboFrameTag, TurboIncludeTags, TurboRefreshMethodTag, TurboRefreshScrollTag, TurboRefreshesWith, TurboStream, TurboStreamFrom, URLField, URLFieldTag, URLFor, URLOptions, URLToAsset, URLToAudio, URLToFont, URLToImage, URLToJavascript, URLToStylesheet, URLToVideo, UTF8EnforcerTag, VideoPath, VideoTag, VideoURL, WeekField, WeekFieldTag, WeekdayOptionsForSelect, WeekdaySelect, WithOutputBuffer, WordWrap

Constant Summary collapse

DEPRECATED =
{
	Checkbox: :CheckBox,
	CheckboxTag: :CheckBoxTag,
	CollectionCheckboxes: :CollectionCheckBoxes,
	DateTimeField: :DatetimeField,
	PathToJavaScript: :PathToJavascript,
	DateTimeFieldTag: :DatetimeFieldTag,
	DateTimeLocalField: :DatetimeLocalField,
	DateTimeLocalFieldTag: :DatetimeLocalFieldTag,
	DateTimeSelect: :DatetimeSelect,
	JavaScriptImportModuleTag: :JavascriptImportModuleTag,
	JavaScriptImportMapTags: :JavascriptImportmapTags,
	JavaScriptIncludeTag: :JavascriptIncludeTag,
	JavaScriptPath: :JavascriptPath,
	JavaScriptTag: :JavascriptTag,
	JavaScriptURL: :JavascriptURL,
	LinkIf: :LinkToIf,
	PathToStyleSheet: :PathToStylesheet,
	SanitizeCss: :SanitizeCSS,
	SelectDateTime: :SelectDatetime,
	StyleSheetLinkTag: :StylesheetLinkTag,
	StyleSheetPath: :StylesheetPath,
	StyleSheetURL: :StylesheetURL,
	URLToJavaScript: :URLToJavascript,
	URLToStyleSheet: :URLToStylesheet,
}
T =
Phlex::Rails::Helpers::Translate

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/phlex/rails/helpers.rb', line 230

def self.const_missing(name)
	if (helper_module_name = DEPRECATED[name])
		message = "`Phlex::Rails::Helpers::#{name}` is deprecated. Please use `Phlex::Rails::Helpers::#{helper_module_name}` instead."

		if name.to_s.downcase == helper_module_name.to_s.downcase
			message << " Note the casing of the module name has changed to match the helper method."
		end

		Phlex::Rails::Deprecation.warn(message)

		helper_module = const_get(helper_module_name)
		const_set(name, helper_module)

		helper_module
	else
		super
	end
end