.row
  .col-md-6.col-md-offset-3
    .panel.panel-campo
      .panel-heading
        h3.panel-title
          = t '.password_reset'
      .panel-body
        = form_for @user, url: password_path, html: { class: 'password-form' } do |f|
          = render 'share/flash_messages'
          = render 'share/form_error_messages', form: f
          .form-group
            = f.label :password, class: 'control-label'
            = f.password_field :password, class: 'form-control'
          .form-group
            = f.label :password_confirmation, class: 'control-label'
            = f.password_field :password_confirmation, class: 'form-control'
          .form-group
            = submit_tag t('.save_changes'), class: 'btn btn-default'

javascript:
  $('form.password-form').validate({
    rules: {
      'user[password]': {
        required: true
      },
      'user[password_confirmation]': {
        equalTo: '#user_password'
      }
    },
    messages: {
      'user[password]': {
        required: '#{@user.errors.generate_message :password, :blank}'
      },
      'user[password_confirmation]': {
        equalTo: '#{@user.errors.generate_message :password_confirmation, :confirmation}'
      }
    }
  });

.row
  .col-md-6.col-md-offset-3
    .panel.panel-campo
      .panel-heading
        h3.panel-title
          = t '.password_reset'
      .panel-body
        = form_for @user, url: password_path, html: { class: 'password-form' } do |f|
          = render 'share/flash_messages'
          = render 'share/form_error_messages', form: f
          = hidden_field_tag :email, params[:email]
          = hidden_field_tag :token, params[:token]
          .form-group
            = f.label :password, class: 'control-label'
            = f.password_field :password, class: 'form-control'
          .form-group
            = f.label :password_confirmation, class: 'control-label'
            = f.password_field :password_confirmation, class: 'form-control'
          .form-group
            = submit_tag t('.save_changes'), class: 'btn btn-default'

javascript:
  $('form.password-form').validate({
    rules: {
      'user[password]': {
        required: true
      },
      'user[password_confirmation]': {
        equalTo: '#user_password'
      }
    },
    messages: {
      'user[password]': {
        required: '#{@user.errors.generate_message :password, :blank}'
      },
      'user[password_confirmation]': {
        equalTo: '#{@user.errors.generate_message :password_confirmation, :confirmation}'
      }
    }
  });

Fix password reset form missing token bug
Fix password reset form missing token bug

ZhaoZijie/morning,tengcong/campo,alex-marmot/railsgirlschina,tiseheaini/campo-hm,iec-uestc/tsemple,bxyb214/book,tiseheaini/campo-hm,railsgirls-cn/railsgirlschina,leakeung/campo,fahchen/tsemple,fahchen/tsemple,JuanitoFatas/campo,alex-marmot/campo,xzh2103072/railsgirlschina,railsgirls-cn/railsgirlschina,xzh2103072/railsgirlschina,ZhaoZijie/morning,alex-marmot/railsgirlschina,lite/wechat-dev,xzh2103072/railsgirlschina,lite/wechat-dev,easyhappy/campo,bxyb214/book,easyhappy/campo,tengcong/campo,alex-marmot/campo,easyhappy/campo,w-zengtao/railsgirlschina,leakeung/campo,alex-marmot/campo,railsgirls-cn/railsgirlschina,w-zengtao/railsgirlschina,bxyb214/book,w-zengtao/railsgirlschina,JuanitoFatas/campo,fahchen/tsemple,leakeung/campo,JuanitoFatas/campo,chloerei/campo,iec-uestc/tsemple,ZhaoZijie/morning,lite/wechat-dev,iec-uestc/tsemple,alex-marmot/railsgirlschina,chloerei/campo,bxyb214/book