Skip to content

Instantly share code, notes, and snippets.

@balvig
Last active October 30, 2019 02:49
Show Gist options
  • Save balvig/9d6269f78c0bfde6c686d328eb1d4772 to your computer and use it in GitHub Desktop.
Save balvig/9d6269f78c0bfde6c686d328eb1d4772 to your computer and use it in GitHub Desktop.
<!-- layouts/application.html.erb -->
<div data-controller="modal">
<%= link_to "Get Started", "#", data-action="modal#show" %>
<div data-target="modal.dialog" style="display: none;">
<% form_for authentications_path do |f| %>
<!-- Form markup -->
<% end %>
</div>
</div>
export default class extends Controller {
static targets = ["dialog"]
show() {
this.dialogTarget.style.display = "block";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment