zy:view routes profile
This commit is contained in:
parent
c29cd77767
commit
9dad27c6da
|
@ -69,9 +69,11 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
redirect_to login_path
|
redirect_to login_path
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def changeprofile
|
||||||
|
render html: "等待完成"
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -84,7 +86,7 @@ class UsersController < ApplicationController
|
||||||
verify_code = rand(999999).to_s
|
verify_code = rand(999999).to_s
|
||||||
result = UserMailer.send_verify_code(user.email, verify_code).deliver_now
|
result = UserMailer.send_verify_code(user.email, verify_code).deliver_now
|
||||||
p result
|
p result
|
||||||
user.update_attribute(:verify_code,verify_code)
|
user.update_attribute(:verify_code, verify_code)
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_change_params(email, verify_code, password, password_confirmation)
|
def check_change_params(email, verify_code, password, password_confirmation)
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
|
|
||||||
<%= render 'layouts/nav' %>
|
<%= render 'layouts/nav' %>
|
||||||
|
|
||||||
<form action="/baidu" class="form-horizontal" id="profile" method="post">
|
<%= form_tag("/changeprofile", method: "post", class: "form-horizontal", id: "profile") do %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="widget-container">
|
<div class="widget-container">
|
||||||
<div class="heading">
|
<div class="heading">
|
||||||
|
@ -23,7 +24,7 @@
|
||||||
<div class="fileupload fileupload-new" data-provides="fileupload">
|
<div class="fileupload fileupload-new" data-provides="fileupload">
|
||||||
<div class="fileupload-new img-thumbnail" style="width: 200px; height: 200px;">
|
<div class="fileupload-new img-thumbnail" style="width: 200px; height: 200px;">
|
||||||
<!--原照片-->
|
<!--原照片-->
|
||||||
<img src="/images/avatars/default/avatar.png">
|
<img src="<%= @user.picurl %>">
|
||||||
</div>
|
</div>
|
||||||
<div class="fileupload-preview fileupload-exists img-thumbnail"
|
<div class="fileupload-preview fileupload-exists img-thumbnail"
|
||||||
style="width: 200px; max-height: 200px">
|
style="width: 200px; max-height: 200px">
|
||||||
|
@ -37,7 +38,7 @@
|
||||||
class="fileupload-exists">
|
class="fileupload-exists">
|
||||||
重新选择
|
重新选择
|
||||||
</span>
|
</span>
|
||||||
<input type="file" name="image_file">
|
<input type="file" name="user[pic]">
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
class="btn btn-default fileupload-exists" data-dismiss="fileupload"
|
class="btn btn-default fileupload-exists" data-dismiss="fileupload"
|
||||||
|
@ -57,14 +58,16 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-2">姓名</label>
|
<label class="control-label col-md-2">姓名</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<input class="form-control" placeholder="Text" type="text">
|
<input class="form-control" placeholder="请输入您的姓名" value="<%= @user.name %>"
|
||||||
|
type="text" name="user[username]">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-2">专业</label>
|
<label class="control-label col-md-2">专业</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<input class="form-control" placeholder="Text" type="text">
|
<input class="form-control" placeholder="请输入您的专业" value="<%= @user.profession %>"
|
||||||
|
type="text" name="user[profession]">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -72,11 +75,11 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-2">学院</label>
|
<label class="control-label col-md-2">学院</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<select class="form-control">
|
<select class="form-control" name="user[academy]">
|
||||||
<option value="Category 1">Option 1</option>
|
<option value="计算机与控制学院">计算机与控制学院</option>
|
||||||
<option value="Category 2">Option 2</option>
|
<option value="数学与系统学院">数学与系统学院</option>
|
||||||
<option value="Category 3">Option 3</option>
|
<option value="电子信息工程学院">电子信息工程学院</option>
|
||||||
<option value="Category 4">Option 4</option>
|
<option value="生命科学院">生命科学院</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -84,9 +87,9 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-2">性别</label>
|
<label class="control-label col-md-2">性别</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<label class="radio-inline"><input name="optionsRadios" type="radio"
|
<label class="radio-inline"><input name="user[sex]" type="radio"
|
||||||
value="1"><span>男</span></label><label
|
value="1" checked="true"><span>男</span></label><label
|
||||||
class="radio-inline"><input name="optionsRadios"
|
class="radio-inline"><input name="user[sex]"
|
||||||
type="radio"
|
type="radio"
|
||||||
value="0"><span>女</span></label>
|
value="0"><span>女</span></label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -102,7 +105,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -11,6 +11,7 @@ Rails.application.routes.draw do
|
||||||
get '/forgetpasswd', to: 'users#forgetpasswd'
|
get '/forgetpasswd', to: 'users#forgetpasswd'
|
||||||
get '/changepasswd', to: 'users#changepasswd'
|
get '/changepasswd', to: 'users#changepasswd'
|
||||||
post '/changepasswd', to: 'users#changepasswd'
|
post '/changepasswd', to: 'users#changepasswd'
|
||||||
|
post '/changeprofile', to: 'users#changeprofile'
|
||||||
|
|
||||||
get '/main', to: 'main#show'
|
get '/main', to: 'main#show'
|
||||||
get '/activity', to: 'main#activity'
|
get '/activity', to: 'main#activity'
|
||||||
|
|
Loading…
Reference in New Issue