From b1b5363972c354411c50bd7f946a014384f069e0 Mon Sep 17 00:00:00 2001 From: Pavel Chipiga Date: Thu, 3 May 2012 19:48:22 +0300 Subject: [PATCH] Fix deploy. Redo main group route. Refs #263 --- Gemfile | 1 + Gemfile.lock | 3 +++ app/views/groups/profile/edit.html.haml | 4 ++-- config/deploy.rb | 14 ++++++-------- config/routes.rb | 3 ++- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 7802d7937..f4bcc710b 100644 --- a/Gemfile +++ b/Gemfile @@ -70,6 +70,7 @@ group :development do gem 'shotgun' # deploy gem 'capistrano', :require => false + gem 'rvm-capistrano', :require => false gem 'cape', :require => false gem 'capistrano_colors', :require => false end diff --git a/Gemfile.lock b/Gemfile.lock index 5a00f6b74..4b3b34f2f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -255,6 +255,8 @@ GEM ruby-openid (2.1.8) russian (0.6.0) i18n (>= 0.5.0) + rvm-capistrano (1.1.0) + capistrano (>= 2.0.0) sanitize (2.0.3) nokogiri (>= 1.4.4, < 1.6) sass (3.1.16) @@ -358,6 +360,7 @@ DEPENDENCIES rspec-rails (~> 2.9.0) ruby-haml-js (~> 0.0.3) russian (~> 0.6.0) + rvm-capistrano sass-rails (~> 3.2.5) shotgun shoulda diff --git a/app/views/groups/profile/edit.html.haml b/app/views/groups/profile/edit.html.haml index fca9df91c..e4846961f 100644 --- a/app/views/groups/profile/edit.html.haml +++ b/app/views/groups/profile/edit.html.haml @@ -1,5 +1,5 @@ -set_meta_tags :title => [title_object(@group), t('layout.groups.edit')] -= form_for @group do |f| += form_for @group, :url => profile_group_path(@group) do |f| = render "form", :f => f .hr @@ -9,7 +9,7 @@ .hr .leftside= t("layout.groups.delete_warning") .rightside - = link_to t("layout.delete"), group_path(@group), :method => :delete, :confirm => t("layout.groups.confirm_delete"), :class => 'button' if can? :destroy, @group + = link_to t("layout.delete"), profile_group_path(@group), :method => :delete, :confirm => t("layout.groups.confirm_delete"), :class => 'button' if can? :destroy, @group .both - content_for :sidebar, render('sidebar') diff --git a/config/deploy.rb b/config/deploy.rb index 74734e310..ac5e272f1 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,7 +1,6 @@ # -*- encoding : utf-8 -*- -$:.unshift File.expand_path('.') -$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) -set :rvm_type, :user +require 'cape' +require 'capistrano_colors' set :default_environment, { 'LANG' => 'en_US.UTF-8' @@ -34,10 +33,10 @@ set :scm, :git set :repository, "git@github.com:warpc/rosa-build.git" set :deploy_via, :remote_cache -require 'lib/recipes/nginx' -require 'lib/recipes/unicorn' -require 'lib/recipes/bluepill' -require 'lib/recipes/delayed_job' +require './lib/recipes/nginx' +require './lib/recipes/unicorn' +require './lib/recipes/bluepill' +require './lib/recipes/delayed_job' namespace :deploy do task :stub_xml_rpc do @@ -92,7 +91,6 @@ after "deploy:restart", "delayed_job:restart" after "deploy:restart", "deploy:cleanup" -require 'cape' namespace :rake_tasks do Cape do mirror_rake_tasks 'db:seeds' diff --git a/config/routes.rb b/config/routes.rb index 37de8ec35..f410c1519 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -82,6 +82,7 @@ Rosa::Application.routes.draw do scope :module => 'groups' do resources :groups, :controller => 'profile' do + get '/' => 'groups/profile#show', :as => :profile, :on => :member get :autocomplete_group_uname, :on => :collection delete :remove_user, :on => :member resources :members, :only => [:index] do @@ -120,7 +121,7 @@ Rosa::Application.routes.draw do get '/' => 'users/profile#show', :as => :user end constraints OwnerConstraint.new(Group, true) do - get '/' => 'groups/profile#show', :as => :group_profile + get '/' => 'groups/profile#show', :as => :group end scope ':project_name', :as => 'project', :module => 'projects' do resources :wiki do