<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) { link_to idv_phone_path, **tag_options, &block },
+ url: idv_phone_path,
big: true,
wide: true,
).with_content(t('idv.failure.phone.warning.try_again_button')) %>
@@ -51,7 +51,7 @@
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) { link_to idv_request_letter_path, **tag_options, &block },
+ url: idv_request_letter_path,
big: true,
wide: true,
outline: true,
diff --git a/app/views/idv/session_errors/warning.html.erb b/app/views/idv/session_errors/warning.html.erb
index 97f32940ff1..389c0371f4b 100644
--- a/app/views/idv/session_errors/warning.html.erb
+++ b/app/views/idv/session_errors/warning.html.erb
@@ -16,7 +16,7 @@
<%= t('idv.warning.attempts_html', count: @remaining_submit_attempts) %>
<% c.with_action_button(
- action: ->(**tag_options, &block) { link_to(@try_again_path, **tag_options, &block) },
+ url: @try_again_path,
class: 'margin-bottom-2',
) { t('idv.forgot_password.try_again') } %>
<% end %>
diff --git a/app/views/idv/unavailable/show.html.erb b/app/views/idv/unavailable/show.html.erb
index f146086e85f..762fd5dd998 100644
--- a/app/views/idv/unavailable/show.html.erb
+++ b/app/views/idv/unavailable/show.html.erb
@@ -28,13 +28,7 @@
<% c.with_action_button(
- action: ->(**tag_options, &block) do
- link_to(
- return_to_sp_failure_to_proof_path(step: :unavailable, location: :unavailable),
- **tag_options,
- &block
- )
- end,
+ url: return_to_sp_failure_to_proof_path(step: :unavailable, location: :unavailable),
big: true,
wide: true,
).with_content(t('idv.unavailable.exit_button', app_name: APP_NAME)) %>
diff --git a/app/views/sign_up/cancellations/new.html.erb b/app/views/sign_up/cancellations/new.html.erb
index 441b4916573..330d7bf4f8e 100644
--- a/app/views/sign_up/cancellations/new.html.erb
+++ b/app/views/sign_up/cancellations/new.html.erb
@@ -15,15 +15,12 @@
<% c.with_action_button(
- action: ->(**tag_options, &block) do
- button_to(sign_up_destroy_path, method: :delete, **tag_options, &block)
- end,
+ url: sign_up_destroy_path,
+ method: :delete,
) { t('forms.buttons.cancel') } %>
<% c.with_action_button(
- action: ->(**tag_options, &block) do
- link_to(@presenter.go_back_path, **tag_options, &block)
- end,
+ url: @presenter.go_back_path,
outline: true,
) { t('links.go_back') } %>
<% end %>
diff --git a/app/views/two_factor_authentication/otp_verification/show.html.erb b/app/views/two_factor_authentication/otp_verification/show.html.erb
index 949b607e0ed..cb2058b83d1 100644
--- a/app/views/two_factor_authentication/otp_verification/show.html.erb
+++ b/app/views/two_factor_authentication/otp_verification/show.html.erb
@@ -43,18 +43,12 @@
<%= hidden_field_tag 'otp_make_default_number',
@presenter.otp_make_default_number %>
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) do
- link_to(
- otp_send_path(
- otp_delivery_selection_form: {
- otp_delivery_preference: @presenter.otp_delivery_preference,
- resend: true,
- },
- ),
- **tag_options,
- &block
- )
- end,
+ url: otp_send_path(
+ otp_delivery_selection_form: {
+ otp_delivery_preference: @presenter.otp_delivery_preference,
+ resend: true,
+ },
+ ),
outline: true,
icon: :loop,
class: 'margin-bottom-neg-1',
diff --git a/app/views/two_factor_authentication/piv_cac_verification/show.html.erb b/app/views/two_factor_authentication/piv_cac_verification/show.html.erb
index 9e093a06df7..b0141e96384 100644
--- a/app/views/two_factor_authentication/piv_cac_verification/show.html.erb
+++ b/app/views/two_factor_authentication/piv_cac_verification/show.html.erb
@@ -8,9 +8,7 @@
<%= render SpinnerButtonComponent.new(
- action: ->(**tag_options, &block) do
- link_to(@presenter.piv_cac_service_link, **tag_options, &block)
- end,
+ url: @presenter.piv_cac_service_link,
big: true,
wide: true,
).with_content(@presenter.piv_cac_capture_text) %>
diff --git a/app/views/users/backup_code_setup/confirm_backup_codes.html.erb b/app/views/users/backup_code_setup/confirm_backup_codes.html.erb
index 8bc49771707..5e6791c86c1 100644
--- a/app/views/users/backup_code_setup/confirm_backup_codes.html.erb
+++ b/app/views/users/backup_code_setup/confirm_backup_codes.html.erb
@@ -11,7 +11,7 @@
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) { link_to(authentication_methods_setup_path, **tag_options, &block) },
+ url: authentication_methods_setup_path,
big: true,
full_width: false,
class: 'margin-top-3 margin-bottom-1',
@@ -24,5 +24,5 @@
class: 'usa-button usa-button--unstyled',
) do %>
<%= t('forms.buttons.continue') %>
- <% end %>
+ <% end %>
<% end %>
diff --git a/app/views/users/piv_cac_login/new.html.erb b/app/views/users/piv_cac_login/new.html.erb
index 4420343cdc5..fa368fdeea9 100644
--- a/app/views/users/piv_cac_login/new.html.erb
+++ b/app/views/users/piv_cac_login/new.html.erb
@@ -7,9 +7,7 @@
<%= render SpinnerButtonComponent.new(
- action: ->(**tag_options, &block) do
- link_to(@presenter.piv_cac_service_link, **tag_options, &block)
- end,
+ url: @presenter.piv_cac_service_link,
big: true,
wide: true,
).with_content(@presenter.piv_cac_capture_text) %>
diff --git a/app/views/users/piv_cac_recommended/show.html.erb b/app/views/users/piv_cac_recommended/show.html.erb
index 3e7ef1e0167..0390f1bb1fd 100644
--- a/app/views/users/piv_cac_recommended/show.html.erb
+++ b/app/views/users/piv_cac_recommended/show.html.erb
@@ -9,25 +9,15 @@
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) do
- button_to(
- login_piv_cac_recommended_add_path,
- **tag_options,
- &block
- )
- end,
+ url: login_piv_cac_recommended_add_path,
+ method: :post,
big: true,
class: 'margin-top-5 margin-bottom-2',
).with_content(t('two_factor_authentication.piv_cac_upsell.add_piv')) %>
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) do
- button_to(
- login_piv_cac_recommended_skip_path,
- **tag_options,
- &block
- )
- end,
+ url: login_piv_cac_recommended_skip_path,
+ method: :post,
unstyled: true,
).with_content(@recommended_presenter.skip_text) %>
diff --git a/app/views/users/piv_cac_setup_from_sign_in/prompt.html.erb b/app/views/users/piv_cac_setup_from_sign_in/prompt.html.erb
index 5a9f2dec11c..bd7f7931cfb 100644
--- a/app/views/users/piv_cac_setup_from_sign_in/prompt.html.erb
+++ b/app/views/users/piv_cac_setup_from_sign_in/prompt.html.erb
@@ -28,9 +28,8 @@
<% end %>
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) do
- button_to(login_add_piv_cac_prompt_path, **tag_options, method: :post, &block)
- end,
+ url: login_add_piv_cac_prompt_path,
+ method: :post,
big: true,
wide: true,
outline: true,
diff --git a/app/views/users/second_mfa_reminder/new.html.erb b/app/views/users/second_mfa_reminder/new.html.erb
index 9ed32547b23..939e54457c6 100644
--- a/app/views/users/second_mfa_reminder/new.html.erb
+++ b/app/views/users/second_mfa_reminder/new.html.erb
@@ -8,22 +8,16 @@
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) do
- button_to(
- second_mfa_reminder_path,
- **tag_options,
- params: { add_method: true },
- &block
- )
- end,
+ url: second_mfa_reminder_path,
+ method: :post,
+ params: { add_method: true },
big: true,
full_width: true,
class: 'margin-bottom-2',
).with_content(t('users.second_mfa_reminder.add_method')) %>
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) do
- button_to(second_mfa_reminder_path, **tag_options, &block)
- end,
+ url: second_mfa_reminder_path,
+ method: :post,
outline: true,
big: true,
full_width: true,
diff --git a/app/views/users/verify_personal_key/new.html.erb b/app/views/users/verify_personal_key/new.html.erb
index 5e18a7f4e56..2d67c9f9aaa 100644
--- a/app/views/users/verify_personal_key/new.html.erb
+++ b/app/views/users/verify_personal_key/new.html.erb
@@ -21,9 +21,8 @@
<%= t('forms.personal_key.alternative') %>
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) do
- button_to(reactivate_account_path, method: :put, **tag_options, &block)
- end,
+ url: reactivate_account_path,
+ method: :put,
unstyled: true,
).with_content(t('links.reverify')) %>
diff --git a/spec/components/button_component_spec.rb b/spec/components/button_component_spec.rb
index 57bfc72d25a..4308b83c3f3 100644
--- a/spec/components/button_component_spec.rb
+++ b/spec/components/button_component_spec.rb
@@ -116,22 +116,6 @@
end
end
- context 'with custom button action' do
- it 'calls the action with content and tag_options' do
- rendered = render_inline ButtonComponent.new(
- action: ->(**tag_options, &block) do
- content_tag(:'lg-custom-button', **tag_options, data: { extra: '' }, &block)
- end,
- class: 'custom-class',
- ).with_content(content)
-
- expect(rendered).to have_css(
- 'lg-custom-button[data-extra].custom-class',
- text: content,
- )
- end
- end
-
context 'with url' do
let(:url) { '/' }
let(:options) { { url: } }
diff --git a/spec/components/previews/button_component_preview.rb b/spec/components/previews/button_component_preview.rb
index a3480216907..dafe4588672 100644
--- a/spec/components/previews/button_component_preview.rb
+++ b/spec/components/previews/button_component_preview.rb
@@ -34,16 +34,6 @@ def unstyled
def danger
render(ButtonComponent.new(danger: true).with_content('Button'))
end
-
- def with_custom_action
- render(
- ButtonComponent.new(
- action: ->(**tag_options, &block) do
- content_tag(:'lg-custom-button', **tag_options, &block)
- end,
- ).with_content('Button'),
- )
- end
# @!endgroup
# rubocop:disable Layout/LineLength