From 433cb198fa930344c7352250dfaae9857f7ba471 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 2 Apr 2017 04:10:22 +0200 Subject: [PATCH] Fix landing page sign up form ignoring username field --- app/controllers/about_controller.rb | 3 +++ app/views/about/index.html.haml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/about_controller.rb b/app/controllers/about_controller.rb index 491036db283..abf4b7df4ca 100644 --- a/app/controllers/about_controller.rb +++ b/app/controllers/about_controller.rb @@ -5,6 +5,9 @@ class AboutController < ApplicationController def index @description = Setting.site_description + + @user = User.new + @user.build_account end def more diff --git a/app/views/about/index.html.haml b/app/views/about/index.html.haml index be5e406c57b..fdfb2b916f1 100644 --- a/app/views/about/index.html.haml +++ b/app/views/about/index.html.haml @@ -24,7 +24,7 @@ .screenshot-with-signup .mascot= image_tag 'fluffy-elephant-friend.png' - = simple_form_for(:user, url: user_registration_path) do |f| + = simple_form_for(@user, url: user_registration_path) do |f| = f.simple_fields_for :account do |ff| = ff.input :username, autofocus: true, placeholder: t('simple_form.labels.defaults.username'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username') }