zy:view routes profile

This commit is contained in:
lovelyzhang 2017-01-07 12:33:43 +08:00
parent c29cd77767
commit 9dad27c6da
3 changed files with 79 additions and 73 deletions

View File

@ -69,9 +69,11 @@ class UsersController < ApplicationController
end
redirect_to login_path
end
end
def changeprofile
render html: "等待完成"
end
private

View File

@ -6,7 +6,8 @@
<%= 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="widget-container">
<div class="heading">
@ -23,7 +24,7 @@
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="fileupload-new img-thumbnail" style="width: 200px; height: 200px;">
<!--原照片-->
<img src="/images/avatars/default/avatar.png">
<img src="<%= @user.picurl %>">
</div>
<div class="fileupload-preview fileupload-exists img-thumbnail"
style="width: 200px; max-height: 200px">
@ -37,7 +38,7 @@
class="fileupload-exists">
重新选择
</span>
<input type="file" name="image_file">
<input type="file" name="user[pic]">
</span>
<a
class="btn btn-default fileupload-exists" data-dismiss="fileupload"
@ -57,14 +58,16 @@
<div class="form-group">
<label class="control-label col-md-2">姓名</label>
<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 class="form-group">
<label class="control-label col-md-2">专业</label>
<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>
@ -72,11 +75,11 @@
<div class="form-group">
<label class="control-label col-md-2">学院</label>
<div class="col-md-9">
<select class="form-control">
<option value="Category 1">Option 1</option>
<option value="Category 2">Option 2</option>
<option value="Category 3">Option 3</option>
<option value="Category 4">Option 4</option>
<select class="form-control" name="user[academy]">
<option value="计算机与控制学院">计算机与控制学院</option>
<option value="数学与系统学院">数学与系统学院</option>
<option value="电子信息工程学院">电子信息工程学院</option>
<option value="生命科学院">生命科学院</option>
</select>
</div>
</div>
@ -84,9 +87,9 @@
<div class="form-group">
<label class="control-label col-md-2">性别</label>
<div class="col-md-9">
<label class="radio-inline"><input name="optionsRadios" type="radio"
value="1"><span>男</span></label><label
class="radio-inline"><input name="optionsRadios"
<label class="radio-inline"><input name="user[sex]" type="radio"
value="1" checked="true"><span>男</span></label><label
class="radio-inline"><input name="user[sex]"
type="radio"
value="0"><span>女</span></label>
</div>
@ -102,7 +105,7 @@
</div>
</div>
</div>
<% end %>
</form>
</div>
</div>

View File

@ -11,6 +11,7 @@ Rails.application.routes.draw do
get '/forgetpasswd', to: 'users#forgetpasswd'
get '/changepasswd', to: 'users#changepasswd'
post '/changepasswd', to: 'users#changepasswd'
post '/changeprofile', to: 'users#changeprofile'
get '/main', to: 'main#show'
get '/activity', to: 'main#activity'