完成user表单界面

This commit is contained in:
刘惊坤 2015-12-05 14:11:50 +08:00
parent 790ed1b791
commit 384ddb394a
1 changed files with 14 additions and 0 deletions

14
app/views/users/_form.html.haml Executable file
View File

@ -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