phlex-rails 1.1.2 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +4 -6
- data/Gemfile +3 -5
- data/lib/generators/phlex/component/USAGE +1 -1
- data/lib/generators/phlex/component/templates/component.rb.erb +1 -1
- data/lib/generators/phlex/install/install_generator.rb +1 -2
- data/lib/generators/phlex/install/templates/application_layout.rb +1 -1
- data/lib/generators/phlex/view/templates/view.rb.erb +1 -1
- data/lib/phlex/rails/csv.rb +16 -0
- data/lib/phlex/rails/fragment_finder.rb +28 -0
- data/lib/phlex/rails/helper_macros.rb +11 -31
- data/lib/phlex/rails/helpers/action_cable_meta_tag.rb +11 -0
- data/lib/phlex/rails/helpers/action_name.rb +10 -0
- data/lib/phlex/rails/helpers/asset_path.rb +15 -0
- data/lib/phlex/rails/helpers/asset_url.rb +8 -0
- data/lib/phlex/rails/helpers/audio_path.rb +8 -0
- data/lib/phlex/rails/helpers/audio_tag.rb +9 -0
- data/lib/phlex/rails/helpers/audio_url.rb +8 -0
- data/lib/phlex/rails/helpers/auto_discovery_link_tag.rb +9 -0
- data/lib/phlex/rails/helpers/build_tag_values.rb +8 -0
- data/lib/phlex/rails/helpers/button_tag.rb +9 -0
- data/lib/phlex/rails/helpers/button_to.rb +9 -0
- data/lib/phlex/rails/helpers/check_box.rb +9 -0
- data/lib/phlex/rails/helpers/check_box_tag.rb +9 -0
- data/lib/phlex/rails/helpers/class_names.rb +8 -0
- data/lib/phlex/rails/helpers/collection_check_boxes.rb +10 -0
- data/lib/phlex/rails/helpers/collection_radio_buttons.rb +10 -0
- data/lib/phlex/rails/helpers/collection_select.rb +9 -0
- data/lib/phlex/rails/helpers/color_field.rb +9 -0
- data/lib/phlex/rails/helpers/color_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/compute_asset_extname.rb +8 -0
- data/lib/phlex/rails/helpers/compute_asset_host.rb +8 -0
- data/lib/phlex/rails/helpers/compute_asset_path.rb +8 -0
- data/lib/phlex/rails/helpers/content_for.rb +11 -0
- data/lib/phlex/rails/helpers/content_tag.rb +9 -0
- data/lib/phlex/rails/helpers/controller_name.rb +8 -0
- data/lib/phlex/rails/helpers/controller_path.rb +8 -0
- data/lib/phlex/rails/helpers/csp_meta_tag.rb +9 -0
- data/lib/phlex/rails/helpers/csrf_meta_tags.rb +9 -0
- data/lib/phlex/rails/helpers/current_cycle.rb +8 -0
- data/lib/phlex/rails/helpers/current_page.rb +8 -0
- data/lib/phlex/rails/helpers/cycle.rb +8 -0
- data/lib/phlex/rails/helpers/date_field.rb +9 -0
- data/lib/phlex/rails/helpers/date_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/date_select.rb +9 -0
- data/lib/phlex/rails/helpers/datetime_field.rb +9 -0
- data/lib/phlex/rails/helpers/datetime_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/datetime_local_field.rb +9 -0
- data/lib/phlex/rails/helpers/datetime_local_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/datetime_select.rb +9 -0
- data/lib/phlex/rails/helpers/debug.rb +9 -0
- data/lib/phlex/rails/helpers/default_url_options.rb +8 -0
- data/lib/phlex/rails/helpers/distance_of_time_in_words.rb +8 -0
- data/lib/phlex/rails/helpers/distance_of_time_in_words_to_now.rb +8 -0
- data/lib/phlex/rails/helpers/dom_class.rb +8 -0
- data/lib/phlex/rails/helpers/dom_id.rb +8 -0
- data/lib/phlex/rails/helpers/email_field.rb +9 -0
- data/lib/phlex/rails/helpers/email_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/error_message.rb +8 -0
- data/lib/phlex/rails/helpers/error_wrapping.rb +9 -0
- data/lib/phlex/rails/helpers/escape_once.rb +8 -0
- data/lib/phlex/rails/helpers/excerpt.rb +8 -0
- data/lib/phlex/rails/helpers/favicon_link_tag.rb +9 -0
- data/lib/phlex/rails/helpers/field_id.rb +8 -0
- data/lib/phlex/rails/helpers/field_name.rb +8 -0
- data/lib/phlex/rails/helpers/field_set_tag.rb +9 -0
- data/lib/phlex/rails/helpers/fields.rb +10 -0
- data/lib/phlex/rails/helpers/fields_for.rb +10 -0
- data/lib/phlex/rails/helpers/file_field.rb +9 -0
- data/lib/phlex/rails/helpers/file_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/flash.rb +8 -0
- data/lib/phlex/rails/helpers/font_path.rb +8 -0
- data/lib/phlex/rails/helpers/font_url.rb +8 -0
- data/lib/phlex/rails/helpers/form_for.rb +10 -0
- data/lib/phlex/rails/helpers/form_tag.rb +9 -0
- data/lib/phlex/rails/helpers/form_with.rb +10 -0
- data/lib/phlex/rails/helpers/grouped_collection_select.rb +9 -0
- data/lib/phlex/rails/helpers/grouped_options_for_select.rb +9 -0
- data/lib/phlex/rails/helpers/hidden_field.rb +9 -0
- data/lib/phlex/rails/helpers/hidden_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/highlight.rb +9 -0
- data/lib/phlex/rails/helpers/image_path.rb +8 -0
- data/lib/phlex/rails/helpers/image_submit_tag.rb +9 -0
- data/lib/phlex/rails/helpers/image_tag.rb +9 -0
- data/lib/phlex/rails/helpers/image_url.rb +8 -0
- data/lib/phlex/rails/helpers/javascript_import_module_tag.rb +9 -0
- data/lib/phlex/rails/helpers/javascript_importmap_tags.rb +9 -0
- data/lib/phlex/rails/helpers/javascript_include_tag.rb +9 -0
- data/lib/phlex/rails/helpers/javascript_path.rb +8 -0
- data/lib/phlex/rails/helpers/javascript_tag.rb +9 -0
- data/lib/phlex/rails/helpers/javascript_url.rb +8 -0
- data/lib/phlex/rails/helpers/l.rb +8 -0
- data/lib/phlex/rails/helpers/label.rb +8 -0
- data/lib/phlex/rails/helpers/label_tag.rb +9 -0
- data/lib/phlex/rails/helpers/link_to.rb +9 -0
- data/lib/phlex/rails/helpers/link_to_if.rb +9 -0
- data/lib/phlex/rails/helpers/link_to_unless.rb +9 -0
- data/lib/phlex/rails/helpers/link_to_unless_current.rb +9 -0
- data/lib/phlex/rails/helpers/localize.rb +8 -0
- data/lib/phlex/rails/helpers/mail_to.rb +9 -0
- data/lib/phlex/rails/helpers/month_field.rb +9 -0
- data/lib/phlex/rails/helpers/month_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/number_field.rb +9 -0
- data/lib/phlex/rails/helpers/number_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/number_to_currency.rb +8 -0
- data/lib/phlex/rails/helpers/number_to_human.rb +8 -0
- data/lib/phlex/rails/helpers/number_to_human_size.rb +8 -0
- data/lib/phlex/rails/helpers/number_to_percentage.rb +8 -0
- data/lib/phlex/rails/helpers/number_to_phone.rb +8 -0
- data/lib/phlex/rails/helpers/number_with_delimiter.rb +8 -0
- data/lib/phlex/rails/helpers/number_with_precision.rb +8 -0
- data/lib/phlex/rails/helpers/object.rb +8 -0
- data/lib/phlex/rails/helpers/option_groups_from_collection_for_select.rb +9 -0
- data/lib/phlex/rails/helpers/options_for_select.rb +9 -0
- data/lib/phlex/rails/helpers/options_from_collection_for_select.rb +9 -0
- data/lib/phlex/rails/helpers/password_field.rb +9 -0
- data/lib/phlex/rails/helpers/password_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/path_to_asset.rb +8 -0
- data/lib/phlex/rails/helpers/path_to_audio.rb +8 -0
- data/lib/phlex/rails/helpers/path_to_font.rb +8 -0
- data/lib/phlex/rails/helpers/path_to_image.rb +8 -0
- data/lib/phlex/rails/helpers/path_to_javascript.rb +8 -0
- data/lib/phlex/rails/helpers/path_to_stylesheet.rb +8 -0
- data/lib/phlex/rails/helpers/path_to_video.rb +8 -0
- data/lib/phlex/rails/helpers/phone_field.rb +9 -0
- data/lib/phlex/rails/helpers/phone_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/phone_to.rb +9 -0
- data/lib/phlex/rails/helpers/pluralize.rb +9 -0
- data/lib/phlex/rails/helpers/preload_link_tag.rb +9 -0
- data/lib/phlex/rails/helpers/provide.rb +8 -0
- data/lib/phlex/rails/helpers/public_compute_asset_path.rb +8 -0
- data/lib/phlex/rails/helpers/radio_button.rb +9 -0
- data/lib/phlex/rails/helpers/radio_button_tag.rb +9 -0
- data/lib/phlex/rails/helpers/range_field.rb +9 -0
- data/lib/phlex/rails/helpers/range_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/request.rb +8 -0
- data/lib/phlex/rails/helpers/reset_cycle.rb +8 -0
- data/lib/phlex/rails/helpers/rich_text_area.rb +9 -0
- data/lib/phlex/rails/helpers/sanitize.rb +8 -0
- data/lib/phlex/rails/helpers/sanitize_css.rb +8 -0
- data/lib/phlex/rails/helpers/search_field.rb +9 -0
- data/lib/phlex/rails/helpers/search_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/select.rb +9 -0
- data/lib/phlex/rails/helpers/select_date.rb +9 -0
- data/lib/phlex/rails/helpers/select_datetime.rb +9 -0
- data/lib/phlex/rails/helpers/select_day.rb +9 -0
- data/lib/phlex/rails/helpers/select_hour.rb +9 -0
- data/lib/phlex/rails/helpers/select_minute.rb +9 -0
- data/lib/phlex/rails/helpers/select_month.rb +9 -0
- data/lib/phlex/rails/helpers/select_second.rb +9 -0
- data/lib/phlex/rails/helpers/select_tag.rb +9 -0
- data/lib/phlex/rails/helpers/select_time.rb +9 -0
- data/lib/phlex/rails/helpers/select_year.rb +9 -0
- data/lib/phlex/rails/helpers/simple_format.rb +9 -0
- data/lib/phlex/rails/helpers/sms_to.rb +9 -0
- data/lib/phlex/rails/helpers/strip_links.rb +8 -0
- data/lib/phlex/rails/helpers/strip_tags.rb +8 -0
- data/lib/phlex/rails/helpers/stylesheet_link_tag.rb +9 -0
- data/lib/phlex/rails/helpers/stylesheet_path.rb +8 -0
- data/lib/phlex/rails/helpers/stylesheet_url.rb +8 -0
- data/lib/phlex/rails/helpers/submit_tag.rb +9 -0
- data/lib/phlex/rails/helpers/t.rb +3 -0
- data/lib/phlex/rails/helpers/telephone_field.rb +9 -0
- data/lib/phlex/rails/helpers/telephone_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/text_area.rb +9 -0
- data/lib/phlex/rails/helpers/text_area_tag.rb +9 -0
- data/lib/phlex/rails/helpers/text_field.rb +9 -0
- data/lib/phlex/rails/helpers/text_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/time_ago_in_words.rb +8 -0
- data/lib/phlex/rails/helpers/time_field.rb +9 -0
- data/lib/phlex/rails/helpers/time_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/time_select.rb +9 -0
- data/lib/phlex/rails/helpers/time_tag.rb +9 -0
- data/lib/phlex/rails/helpers/time_zone_options_for_select.rb +9 -0
- data/lib/phlex/rails/helpers/time_zone_select.rb +9 -0
- data/lib/phlex/rails/helpers/token_list.rb +8 -0
- data/lib/phlex/rails/helpers/translate.rb +25 -0
- data/lib/phlex/rails/helpers/truncate.rb +8 -0
- data/lib/phlex/rails/helpers/turbo_frame_tag.rb +8 -0
- data/lib/phlex/rails/helpers/turbo_include_tags.rb +8 -0
- data/lib/phlex/rails/helpers/turbo_refresh_method_tag.rb +8 -0
- data/lib/phlex/rails/helpers/turbo_refresh_scroll_tag.rb +8 -0
- data/lib/phlex/rails/helpers/turbo_refreshes_with.rb +9 -0
- data/lib/phlex/rails/helpers/turbo_stream_from.rb +8 -0
- data/lib/phlex/rails/helpers/url_field.rb +9 -0
- data/lib/phlex/rails/helpers/url_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/url_for.rb +8 -0
- data/lib/phlex/rails/helpers/url_options.rb +8 -0
- data/lib/phlex/rails/helpers/url_to_asset.rb +8 -0
- data/lib/phlex/rails/helpers/url_to_audio.rb +8 -0
- data/lib/phlex/rails/helpers/url_to_font.rb +8 -0
- data/lib/phlex/rails/helpers/url_to_image.rb +8 -0
- data/lib/phlex/rails/helpers/url_to_javascript.rb +8 -0
- data/lib/phlex/rails/helpers/url_to_stylesheet.rb +8 -0
- data/lib/phlex/rails/helpers/url_to_video.rb +8 -0
- data/lib/phlex/rails/helpers/utf8_enforcer_tag.rb +9 -0
- data/lib/phlex/rails/helpers/video_path.rb +8 -0
- data/lib/phlex/rails/helpers/video_tag.rb +9 -0
- data/lib/phlex/rails/helpers/video_url.rb +8 -0
- data/lib/phlex/rails/helpers/week_field.rb +9 -0
- data/lib/phlex/rails/helpers/week_field_tag.rb +9 -0
- data/lib/phlex/rails/helpers/weekday_options_for_select.rb +9 -0
- data/lib/phlex/rails/helpers/weekday_select.rb +9 -0
- data/lib/phlex/rails/helpers/with_output_buffer.rb +9 -0
- data/lib/phlex/rails/helpers/word_wrap.rb +8 -0
- data/lib/phlex/rails/helpers.rb +243 -1458
- data/lib/phlex/rails/html/method_missing.rb +13 -0
- data/lib/phlex/rails/html.rb +11 -0
- data/lib/phlex/rails/layout.rb +33 -22
- data/lib/phlex/rails/{sgml/overrides.rb → sgml.rb} +31 -17
- data/lib/phlex/rails/streaming.rb +95 -7
- data/lib/phlex/rails/version.rb +1 -1
- data/lib/phlex/rails.rb +25 -22
- metadata +202 -29
- data/CONTRIBUTING.md +0 -23
- data/lib/generators/phlex/controller/USAGE +0 -10
- data/lib/generators/phlex/controller/controller_generator.rb +0 -74
- data/lib/generators/phlex/controller/templates/controller.rb.erb +0 -14
- data/lib/generators/phlex/controller/templates/view.rb.erb +0 -9
- data/lib/generators/rspec/view/templates/view_spec.rb.erb +0 -10
- data/lib/generators/rspec/view/view_generator.rb +0 -14
- data/lib/generators/test_unit/templates/view_test.rb.erb +0 -15
- data/lib/generators/test_unit/view_generator.rb +0 -12
- data/lib/phlex/rails/html/format.rb +0 -8
- data/lib/phlex/rails/sgml/class_methods.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93b219be78b50160aa9712bfec6ff25b59c33f512087cda4ee027a1f0f39ff05
|
4
|
+
data.tar.gz: 55c366bb60dc4f5bb343317e9c948642fb5121d9e3ec65372392c2b5a751fe81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65519c2590bff066155afb33418089c948a4fb7dbdceb9cdfbaac5a2d88a4fa2a86432b19ba9b6f42af8578d84e7469bde1cd66137f572ca84d691031f91de27
|
7
|
+
data.tar.gz: cc3773ccad8dc3bfcc4a3267cc1c78189560e93d0bff31e1930d4cafb036724483f17e4923dc13acbcf3d50b2baa7d92da7f6f694205066bfc3860668983c5bc
|
data/Appraisals
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
appraise "rails-6" do
|
4
|
-
gem "rails", "~> 6"
|
5
|
-
end
|
6
|
-
|
7
3
|
appraise "rails-7" do
|
8
4
|
gem "rails", "~> 7"
|
9
5
|
end
|
10
6
|
|
11
|
-
|
12
|
-
|
7
|
+
if RUBY_VERSION >= "3.1.0"
|
8
|
+
appraise "rails-edge" do
|
9
|
+
gem "rails", github: "rails/rails"
|
10
|
+
end
|
13
11
|
end
|
data/Gemfile
CHANGED
@@ -5,15 +5,13 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
5
|
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem "phlex"
|
9
|
-
gem "phlex-testing-capybara", github: "phlex-ruby/phlex-testing-capybara"
|
10
|
-
gem "combustion"
|
8
|
+
gem "phlex", github: "phlex-ruby/phlex", branch: "1.10"
|
11
9
|
gem "rubocop"
|
12
10
|
gem "solargraph"
|
13
11
|
gem "view_component"
|
14
12
|
gem "appraisal", github: "excid3/appraisal", branch: "fix-bundle-env"
|
15
13
|
gem "yard"
|
16
14
|
|
17
|
-
# Ensure rails is loaded before rspec-rails.
|
18
15
|
gem "rails"
|
19
|
-
gem "
|
16
|
+
gem "puma"
|
17
|
+
gem "sqlite3"
|
@@ -5,7 +5,7 @@ module Phlex::Generators
|
|
5
5
|
source_root File.expand_path("templates", __dir__)
|
6
6
|
|
7
7
|
APPLICATION_CONFIGURATION_PATH = Rails.root.join("config/application.rb")
|
8
|
-
TAILWIND_CONFIGURATION_PATH = Rails.root.join("
|
8
|
+
TAILWIND_CONFIGURATION_PATH = Rails.root.join("tailwind.config.js")
|
9
9
|
|
10
10
|
def autoload_components
|
11
11
|
return unless APPLICATION_CONFIGURATION_PATH.exist?
|
@@ -42,7 +42,6 @@ module Phlex::Generators
|
|
42
42
|
|
43
43
|
insert_into_file TAILWIND_CONFIGURATION_PATH, after: "content: [" do
|
44
44
|
"\n './app/views/**/*.rb'," \
|
45
|
-
"\n './app/components/**/*rb',"
|
46
45
|
end
|
47
46
|
end
|
48
47
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Phlex
|
4
|
+
module Rails
|
5
|
+
module CSV
|
6
|
+
module Overrides
|
7
|
+
def each_item(&block)
|
8
|
+
return super unless collection.is_a?(ActiveRecord::Relation)
|
9
|
+
return super unless collection.arel.orders.empty?
|
10
|
+
|
11
|
+
collection.find_each(&block)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Phlex::Rails::FragmentFinder
|
4
|
+
extend self
|
5
|
+
|
6
|
+
Parser = if defined?(Nokolexbor)
|
7
|
+
Nokolexbor
|
8
|
+
else
|
9
|
+
require "nokogiri"
|
10
|
+
Nokogiri::HTML
|
11
|
+
end
|
12
|
+
|
13
|
+
def extract(html, ids)
|
14
|
+
parsed = Parser.parse(html)
|
15
|
+
selector = ids.map { |id| "##{id}" }.join(", ")
|
16
|
+
|
17
|
+
result = +""
|
18
|
+
|
19
|
+
ids.count.times do
|
20
|
+
if (fragment = parsed.at_css(selector))
|
21
|
+
result << fragment.to_s
|
22
|
+
fragment.remove
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
result
|
27
|
+
end
|
28
|
+
end
|
@@ -1,29 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# @api private
|
4
3
|
module Phlex::Rails::HelperMacros
|
5
|
-
|
6
|
-
|
7
|
-
# frozen_string_literal: true
|
8
|
-
|
9
|
-
def #{method_name}(...)
|
10
|
-
output = helpers.#{method_name}(...)
|
11
|
-
|
12
|
-
case output
|
13
|
-
when ActiveSupport::SafeBuffer
|
14
|
-
@_context.target << output
|
15
|
-
end
|
16
|
-
|
17
|
-
nil
|
18
|
-
end
|
19
|
-
RUBY
|
20
|
-
end
|
21
|
-
|
22
|
-
def define_output_helper_with_capture_block(method_name)
|
4
|
+
# Register a Rails helper that returns safe HTML to be pushed to the output buffer.
|
5
|
+
def register_output_helper(method_name)
|
23
6
|
class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
|
24
7
|
# frozen_string_literal: true
|
25
8
|
|
26
9
|
def #{method_name}(*args, **kwargs, &block)
|
10
|
+
context = @_context
|
11
|
+
return if context.fragments && !context.in_target_fragment
|
12
|
+
|
27
13
|
output = if block
|
28
14
|
helpers.#{method_name}(*args, **kwargs) { capture(&block) }
|
29
15
|
else
|
@@ -40,17 +26,8 @@ module Phlex::Rails::HelperMacros
|
|
40
26
|
RUBY
|
41
27
|
end
|
42
28
|
|
43
|
-
|
44
|
-
|
45
|
-
# frozen_string_literal: true
|
46
|
-
|
47
|
-
def #{method_name}(...)
|
48
|
-
helpers.#{method_name}(...)
|
49
|
-
end
|
50
|
-
RUBY
|
51
|
-
end
|
52
|
-
|
53
|
-
def define_value_helper_with_capture_block(method_name)
|
29
|
+
# Register a Rails helper that returns a value that shouldn’t be pushed to the output buffer.
|
30
|
+
def register_value_helper(method_name)
|
54
31
|
class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
|
55
32
|
# frozen_string_literal: true
|
56
33
|
|
@@ -64,11 +41,14 @@ module Phlex::Rails::HelperMacros
|
|
64
41
|
RUBY
|
65
42
|
end
|
66
43
|
|
67
|
-
|
44
|
+
# @api private
|
45
|
+
def register_builder_yielding_helper(method_name, builder)
|
68
46
|
class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
|
69
47
|
# frozen_string_literal: true
|
70
48
|
|
71
49
|
def #{method_name}(*args, **kwargs)
|
50
|
+
context = @_context
|
51
|
+
return if context.fragments && !context.in_target_fragment
|
72
52
|
output = if block_given?
|
73
53
|
helpers.#{method_name}(*args, **kwargs) { |form|
|
74
54
|
capture do
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Phlex::Rails::Helpers::ActionCableMetaTag
|
4
|
+
extend Phlex::Rails::HelperMacros
|
5
|
+
|
6
|
+
# @!method action_cable_meta_tag
|
7
|
+
# Outputs an "action-cable-url" meta tag with the value of the URL specified in your configuration. Ensure this is above your JavaScript tag:
|
8
|
+
# @see https://api.rubyonrails.org/classes/ActionCable/Helpers/ActionCableHelper.html#method-i-action_cable_meta_tag
|
9
|
+
# @return [nil]
|
10
|
+
register_output_helper :action_cable_meta_tag
|
11
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Phlex::Rails::Helpers::ActionName
|
4
|
+
extend Phlex::Rails::HelperMacros
|
5
|
+
|
6
|
+
# @!method action_name
|
7
|
+
# @return [String] the name of the controller action, e.g. <code>"index"</code>
|
8
|
+
# @see https://api.rubyonrails.org/classes/AbstractController/Base.html#method-i-action_name
|
9
|
+
register_value_helper :action_name
|
10
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Phlex::Rails::Helpers::AssetPath
|
4
|
+
extend Phlex::Rails::HelperMacros
|
5
|
+
|
6
|
+
# @!method asset_path(source, host: nil, protocol: nil, type: nil, skip_pipeline: nil, extname: nil)
|
7
|
+
# @param source [String]
|
8
|
+
# @param host [String]
|
9
|
+
# @param protocol [String] e.g. <code>"https"</code>
|
10
|
+
# @param type [Symbol] e.g. <code>:javascript</code>
|
11
|
+
# @param skip_pipeline [bool]
|
12
|
+
# @param extname [String] e.g. <code>".js"</code>
|
13
|
+
# @see https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-asset_path
|
14
|
+
register_value_helper :asset_path
|
15
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Phlex::Rails::Helpers::CollectionCheckBoxes
|
4
|
+
extend Phlex::Rails::HelperMacros
|
5
|
+
|
6
|
+
# @!method collection_check_boxes(...)
|
7
|
+
# @yield [builder]
|
8
|
+
# @yieldparam builder [Phlex::Rails::BufferedCheckboxBuilder]
|
9
|
+
register_builder_yielding_helper :collection_check_boxes, Phlex::Rails::BufferedCheckboxBuilder
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Phlex::Rails::Helpers::CollectionRadioButtons
|
4
|
+
extend Phlex::Rails::HelperMacros
|
5
|
+
|
6
|
+
# @!method collection_radio_buttons(...)
|
7
|
+
# @yield [builder]
|
8
|
+
# @yieldparam builder [Phlex::Rails::BufferedRadioButtonBuilder]
|
9
|
+
register_builder_yielding_helper :collection_radio_buttons, Phlex::Rails::BufferedRadioButtonBuilder
|
10
|
+
end
|