diff --git a/app/controllers/homework_bank_controller.rb b/app/controllers/homework_bank_controller.rb index f1101d86e..2f62ffdc3 100644 --- a/app/controllers/homework_bank_controller.rb +++ b/app/controllers/homework_bank_controller.rb @@ -1,6 +1,6 @@ class HomeworkBankController < ApplicationController before_filter :require_login, :only => [:index, :show, :new, :create, :edit, :update, :destroy, :destroy_all, :choose_user_course, :send_h_bank_to_course] - before_filter :find_homework_bank, :only => [:show, :edit, :update, :destroy] + before_filter :find_homework_bank, :only => [:show, :edit, :update, :destroy, :set_public] def index @order,@b_sort = params[:order] || "updated_at",params[:sort] || "desc" @@ -221,7 +221,10 @@ class HomeworkBankController < ApplicationController def set_public @homework.update_attributes(:is_public => true) - redirect_to homework_bank_index_path() + respond_to do |format| + format.html{ redirect_to homework_bank_path(@homework) } + format.js + end end private diff --git a/app/views/homework_bank/_homework_bank_list.html.erb b/app/views/homework_bank/_homework_bank_list.html.erb index 807ee0205..6f148ccde 100644 --- a/app/views/homework_bank/_homework_bank_list.html.erb +++ b/app/views/homework_bank/_homework_bank_list.html.erb @@ -53,6 +53,11 @@
<%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '课堂教学', courses_path() %> > 题库
+<%= link_to User.current.show_real_name, user_path(User.current) %> > <%= link_to '课堂教学', courses_path() %> > 题库
- <%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '课堂教学', courses_path() %> > <%= @homework.user == User.current ? link_to('我的题库', homework_bank_index_path()) : link_to('公共题库', homework_bank_index_path(:type => 2)) %>
+ <%= link_to User.current.show_real_name, user_path(User.current) %> > <%= link_to '课堂教学', courses_path() %> > <%= @homework.user == User.current ? link_to('我的题库', homework_bank_index_path()) : link_to('公共题库', homework_bank_index_path(:type => 2)) %><% unless @homework.is_public %>