phlex-ruby / phlex

A framework for building object-oriented views in Ruby.
https://beta.phlex.fun
MIT License
1.3k stars 84 forks source link

Detect invalid `href` attributes #817

Closed joeldrapper closed 1 week ago

joeldrapper commented 1 month ago

Closes #816

joelmoss commented 1 month ago

Not tried this yet, but phlexible overrides the a method in order to allow passing Rails route helpers to the href. Basically in the same way that the Rails link_to helper passes it's URL argument to the url_for helper.

So I can do things like...

a(href: :some_route) { 'click me' }
a(href: article) { 'click me' }
a(href: [user, :articles]) { 'click me' }

I'm hoping that this change will not break the above 🤞

joeldrapper commented 1 month ago

It should be fine if you’re only passing a string up to super.