Skip to content

Instantly share code, notes, and snippets.

@9876691
Created September 7, 2018 14:01
Show Gist options
  • Save 9876691/fa2d20b7d87c990979dd1ac62789a30d to your computer and use it in GitHub Desktop.
Save 9876691/fa2d20b7d87c990979dd1ac62789a30d to your computer and use it in GitHub Desktop.
class SignIns::NewPage < GuestLayout
needs form : SignInForm
def content
h1 "Sign In"
render_sign_in_form(@form)
end
private def render_sign_in_form(f)
form_for SignIns::Create do
sign_in_fields(f)
submit "Sign In", flow_id: "sign-in-button"
end
link "Reset password", to: PasswordResetRequests::New
text " | "
link "Sign up", to: SignUps::New
end
private def sign_in_fields(f)
field(f.email) { |i| email_input i, autofocus: "true" }
field(f.password) { |i| password_input i }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment