From 384ddb394a57e7767017013f4e442e56af6c7bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=83=8A=E5=9D=A4?= Date: Sat, 5 Dec 2015 14:11:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90user=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_form.html.haml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 app/views/users/_form.html.haml diff --git a/app/views/users/_form.html.haml b/app/views/users/_form.html.haml new file mode 100755 index 0000000..7859877 --- /dev/null +++ b/app/views/users/_form.html.haml @@ -0,0 +1,14 @@ +- method = action == 'update' ? 'put' : 'post' +- submit_url = case action; when 'register'; register_confirm_users_path; when 'login'; login_confirm_users_path; when 'update'; user_path(@user); end += form_for @user, method: method, url: submit_url, role: 'form' do |f| + .form-field.form-group + = f.text_field :username, placeholder: '用户名', class: 'form-control username', required: true + .form-field.form-group + = f.text_field :email, placeholder: '邮箱', class: 'form-control email', required: true + .form-field.form-group + = f.password_field :password, placeholder: '密码,最少6位', class: 'form-control password', required: true + .form-field.form-group + = f.password_field :password_confirmation, placeholder: '确认密码', class: 'form-control password', required: true + = submit_tag '注册', class: 'btn btn-primary btn-lg' + .action-wrapper + = link_to '已有账号?', login_path \ No newline at end of file