修改学校链接
This commit is contained in:
parent
b42d742c06
commit
3e185c3a4b
|
@ -105,7 +105,7 @@ class SchoolController < ApplicationController
|
|||
end
|
||||
options = ""
|
||||
@school.each do |s|
|
||||
options << "<li style = 'width: 33%; float: left'><a id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
|
||||
options << "<li style = 'width: 33%; float: left'> <a id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
|
||||
end
|
||||
|
||||
render :text => options
|
||||
|
|
|
@ -44,8 +44,16 @@
|
|||
<script type="text/javascript">
|
||||
function test(id){
|
||||
|
||||
location.href = encodeURI('http://course.trustie.net<%=port%>?school_id='+id);
|
||||
$.ajax({
|
||||
url: '<%=school_course_list_path%>',
|
||||
type: "POST",
|
||||
data: {
|
||||
school_id: id
|
||||
}
|
||||
|
||||
}).complete(eval_ajax);
|
||||
}
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function ssearch(){
|
||||
|
@ -70,8 +78,8 @@
|
|||
<div>
|
||||
<p>
|
||||
|
||||
<a href="http://course.trustie.net<%=port%>?school_id=0">全部学校</a>
|
||||
<%= link_to '我的学校',scholl_course_list_path(User.current.user_extensions.school) %>
|
||||
<%= link_to "全部学校",school_index_path %>
|
||||
<%= link_to '我的学校',school_course_list_path(User.current.user_extensions.school) %>
|
||||
</p>
|
||||
<ul>
|
||||
<li style="width: 40%; float: left">请选择省份:
|
||||
|
|
|
@ -700,7 +700,7 @@ RedmineApp::Application.routes.draw do
|
|||
#######confusing########
|
||||
get 'welcome/search', to: 'welcome#search'
|
||||
get 'school/index', to: 'school#index'
|
||||
get 'course/:school_id', to: 'welcome#course', :as => 'scholl_course_list'
|
||||
get 'course/:school_id', to: 'welcome#course', :as => 'school_course_list'
|
||||
#get 'course/:school_id', to: 'welcome#course'
|
||||
post 'school/get_options/:province', :to => 'school#get_options'
|
||||
get 'school/get_options/:province', :to => 'school#get_options'
|
||||
|
|
Loading…
Reference in New Issue