Ajax branch/tag switch for tree view

This commit is contained in:
Dmitriy Zaporozhets 2012-01-29 21:30:03 +02:00
parent 97e9774336
commit ae5faf0fd3
11 changed files with 151 additions and 110 deletions

View file

@ -13,13 +13,22 @@ class RefsController < ApplicationController
layout "project"
def switch
new_path = if params[:destination] == "tree"
tree_project_ref_path(@project, params[:ref])
else
project_commits_path(@project, :ref => params[:ref])
end
respond_to do |format|
format.html do
new_path = if params[:destination] == "tree"
tree_project_ref_path(@project, params[:ref])
else
project_commits_path(@project, :ref => params[:ref])
end
redirect_to new_path
redirect_to new_path
end
format.js do
@ref = params[:ref]
define_tree_vars
render "tree"
end
end
end
#