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

submit helper does not accept block syntax #127

Closed
nerdinand opened this issue Jan 31, 2018 · 3 comments
Closed

submit helper does not accept block syntax #127

nerdinand opened this issue Jan 31, 2018 · 3 comments
Assignees
Milestone

Comments

@nerdinand
Copy link
Contributor

The submit form helper does not seem to accept the block syntax for nesting tags within. Example:

            = form_for :run, routes.unlock_run_path(run_id), method: :post do
              - submit nil, class: 'btn btn-outline-success' do
                - span class: 'oi oi-check'

leads to:

<form action="/runs/1/unlock" method="POST" accept-charset="utf-8" id="run-form">
<input name="_csrf_token" value="..." type="hidden">
<button type="submit" class="btn btn-outline-success"></button>
</form>

Whereas the button helper reacts differently (note the nested span in the html):

            = form_for :run, routes.lock_run_path(run_id), method: :post do
              - button nil, class: 'btn btn-outline-success' do
                - span class: 'oi oi-check'

yields:

<form action="/runs/3/lock" method="POST" accept-charset="utf-8" id="run-form">
<input name="_csrf_token" value="..." type="hidden">
<button class="btn btn-outline-success">
<span class="oi oi-check"></span>
</button>
</form>

Is this by design or a bug?

@AlfonsoUceda
Copy link
Contributor

Hi @nerdinand

I've checked that submit doesn't support a block. In my opinion, I suppose we need to support that because as you example, we could add span tags for adding some CSS rule.

It isn't a bug so I'll mark this issue as enhancement. I'll add as soon as possible ;)

@mereghost
Copy link
Member

I was doing the exact same thing by passing the span helper as the button text.

@jodosha jodosha added this to the v1.2.0 milestone Apr 3, 2018
@jodosha
Copy link
Member

jodosha commented Apr 3, 2018

Implemented by #130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants