Skip to content

Fix the updating issue that was deleting users, by changing the butto…#16

Open
Ayoub-Iken wants to merge 1 commit intomackenziechild:masterfrom
Ayoub-Iken:master
Open

Fix the updating issue that was deleting users, by changing the butto…#16
Ayoub-Iken wants to merge 1 commit intomackenziechild:masterfrom
Ayoub-Iken:master

Conversation

@Ayoub-Iken
Copy link

Update user properly

there was an error in the registrations/edit.html.erb file, that instead of updating the user, it actually delete it, there is 2 ways for solving the issue.

1.nest properly the div

and that by closing the form_for tag before there closure of the panel-body div tag. it could be a little frustrating and confusing.

2. change the button_to tag

the button_to tag actually create a hidden form that in case it was in the same block with the f.submit, would actually take priority, so in this case, we can simply change the button_to to link_to and it should do the trick.

<div class="panel-footer">

    <h3>Cancel my account</h3>

    <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-default" %></p>

  </div>

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant