Skip to content

Instantly share code, notes, and snippets.

@BrandonMathis
Created May 23, 2019 15:13
Show Gist options
  • Save BrandonMathis/674f4f0eece8734ba5cfcdf19f59100a to your computer and use it in GitHub Desktop.
Save BrandonMathis/674f4f0eece8734ba5cfcdf19f59100a to your computer and use it in GitHub Desktop.
<%= form_for @changeset, @action, [multipart: true], fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div class="form-group">
<%= label f, :avatar, class: "control-label" %>
<%= file_input f, :avatar, class: "form-control" %>
<%= error_tag f, :avatar %>
</div>
<div class="form-group">
<%= label f, :username, class: "control-label" %>
<%= text_input f, :username, class: "form-control" %>
<%= error_tag f, :username %>
</div>
<div class="form-group">
<%= label f, :email, class: "control-label" %>
<%= text_input f, :email, class: "form-control" %>
<%= error_tag f, :email %>
</div>
<div class="form-group">
<%= submit "Submit", class: "btn btn-primary" %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment