Skip to content

πŸ”˜ ButtonComponent's button_to Uses method: :getΒ #5890

@landongrindheim

Description

@landongrindheim

πŸ–ΌοΈ Context

When working with ButtonComponent on a recent change, I found myself needing to reach into the internals of the component to understand how to use the component as a button_to replacement/wrapper. As I dug in, I found that we are supplying method: :get to button_to as the default πŸ‘‡

button_to(*args, class: css, method: :get, **options, &block)

button_to relies on using POST as the default, which is what I think we want here.


πŸ€” What I Think Should Happen

  • When using ButtonComponent, the default result should be equivalent to Rails's button_to (with styles applied)
  • When using ButtonComponent, the button_to equivalent should default to method: :post, with the option to override the method
  • When supplying type: :link, the result should be equivalent to Rails's link_to (with styles applied)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions