Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace button helper with standard button_tag #2600

Merged
merged 3 commits into from
Feb 26, 2018

Conversation

jhawthorn
Copy link
Contributor

@jhawthorn jhawthorn commented Feb 23, 2018

This deprecates the button helper in favour of the standard rails button_tag.

The button takes a lot of positional arguments, one of which is deprecated. It's confusing because it looks like a helper that would ship with rails, but it is not.

I'm not sure if the deprecation is too aggressive, as button is used in a lot of extensions and custom store code, but it would be nice to eventually remove.

This generates slightly different markup. Instead of generating

<button class="button" type="submit">Sample text</button>

it generates

<button class="btn btn-primary">Sample text</button>

It should be fine to drop the type="submit", since that is the default, and our CSS button class is basically just an @extend of btn btn-primary.

The conversion was performed mostly with

sed -i "s/<%= button \\(t(['\".a-z_]*)\\) %>/<%= button_tag \1, class: 'btn btn-primary' %>/g" app/views/spree/admin/**/*.html.erb

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very much appreciated 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants