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, ContentSecurityPolicyNonce, 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, FormAuthenticityToken, 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, Notice, 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

REDIRECTS =

These will not be suggested by RubyLSP, but they work as aliases for legacy helper names.

{
	:CheckBox => :Checkbox,
	:CheckBoxTag => :CheckboxTag,
	:CollectionCheckBoxes => :CollectionCheckboxes,
	:JavascriptImportModuleTag => :JavaScriptImportModuleTag,
	:JavascriptImportmapTags => :JavaScriptImportmapTags,
	:JavascriptIncludeTag => :JavaScriptIncludeTag,
	:JavascriptPath => :JavaScriptPath,
	:JavascriptTag => :JavaScriptTag,
	:JavascriptURL => :JavaScriptURL,
	:PathToJavascript => :PathToJavaScript,
	:PathToStylesheet => :PathToStyleSheet,
	:RichTextarea => :RichTextArea,
	:StylesheetLinkTag => :StyleSheetLinkTag,
	:StylesheetPath => :StyleSheetPath,
	:StylesheetURL => :StyleSheetURL,
	:Textarea => :TextArea,
	:TextareaTag => :TextAreaTag,
	:URLToJavascript => :URLToJavaScript,
	:URLToStylesheet => :URLToStyleSheet,
}.freeze
T =
Phlex::Rails::Helpers::Translate

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/phlex/rails/helpers.rb', line 28

def self.const_missing(name)
	if (new_name = REDIRECTS[name])
		mod = const_get(new_name)
		const_set(name, mod)
		mod
	else
		super
	end
end