Skip to content

Invalid output when converting helper call with multi-line args and block #40

@jonathanhefner

Description

@jonathanhefner

When converting passwords/edit.html.erb of the Clearance gem, the following snippet...

<%= form_for :password_reset,
      url: user_password_path(@user, token: @user.confirmation_token),
      html: { method: :put } do |form| %>
  <div class="password-field">
    <%= form.label :password %>
    <%= form.password_field :password %>
  </div>

  <div class="submit-field">
    <%= form.submit %>
  </div>
<% end %>

...Is converted to:

= form_for :password_reset,
-         url: user_password_path(@user, token: @user.confirmation_token),
-         html: { method: :put } do |form|
.password-field
  = form.label :password
  = form.password_field :password
.submit-field
  = form.submit

Note the incorrect field indentation, in addition to the incorrect argument formatting. Perhaps it is the same underlying issue though? (i.e. if the multi-line arguments were correctly recognized and formatted, then the block would be too?)

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