-
Notifications
You must be signed in to change notification settings - Fork 25
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
Ruby blocks are getting lost #37
Comments
I'm not sure what's going on, I tried locally modifying the with_block fixture and couldn't reproduce: <% foo.each do |bar| %>
<p><%= baz %></p>
<% end %>
<%= cb.with_footer(classes: 'pt-0 pb-5') do
turbo_frame_tag "#{identifier}-footer",target: 'inner-frame' do
paginate publications,
params: 1
controller: 'publications',
action: 'index'
outer_window: 2,
window: 2,
views_prefix: 'v4'
end
end %> is it still an issue? maybe a syntax_tree upgrade already fixed it? |
I can reproduce this issue with erb-formatter 0.7.3 and syntax_tree 6.2.0 Given the following snippet, the block will be removed. # The entire block will be removed resulting in <% helper arg %>
<% helper arg do |api|
api.foo
api.bar
api.baz
end %> Removing the argument works: <% helper do |api|
api.foo
api.bar
api.baz
end %> Wrapping the argument in parenthesis also works: <% helper(arg) do |api|
api.foo
api.bar
api.baz
end %> |
tmaier
added a commit
to tmaier/erb-formatter
that referenced
this issue
Aug 25, 2024
smthg similiar to me: - <%= active_admin_form_for :admin_user, url: admin_otp_enable_path, html: { method: :put } do |f|
- f.inputs do
- f.input :otp, label: I18n.t('active_admin.otp.one_time_password')
- end
-
- f.actions do
- f.action :submit, label: I18n.t('active_admin.otp.setup.enable'), button_html: { value: I18n.t('active_admin.otp.setup.enable') }
- end
- end %>
+ <%= active_admin_form_for :admin_user,
+ url: admin_otp_enable_path,
+ html: {
+ method: :put,
+ } %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After running erb-formatter, I see this case a couple of times in the diff:
As you can see, the block within turbo_frame_tag is being lost
The text was updated successfully, but these errors were encountered: