#319: fixed routes errors

This commit is contained in:
Vokhmin Alexey V 2013-11-12 21:13:05 +04:00
parent 900f1f6143
commit 578c868ba1
4 changed files with 4 additions and 2 deletions

View File

@ -86,6 +86,7 @@ class Platforms::RepositoriesController < Platforms::BaseController
if projects_list = params.try(:[], :repository).try(:[], :projects_list)
@repository.add_projects projects_list, current_user
redirect_to platform_repository_path(@platform, @repository), :notice => t('flash.repository.projects_will_be_added')
return
end
if params[:project_id]
@project = Project.find(params[:project_id])

View File

@ -3,7 +3,7 @@
%h3= raw "#{t("layout.repositories.add_projects_to")}: #{link_to @repository.name, platform_repository_path(@platform, @repository)}"
= form_for :repository, :url => add_project_platform_repository_path(@platform, @repository), :html => { :class => :form } do |f|
= form_for :repository, :url => add_project_platform_repository_path(@platform, @repository), :method => :put, :html => { :class => :form } do |f|
.leftlist= f.label :projects_list
.rightlist= f.text_area :projects_list
.both

View File

@ -3,7 +3,7 @@
%h3= raw "#{t("layout.repositories.remove_projects_from")}: #{link_to @repository.name, platform_repository_path(@platform, @repository)}"
= form_for :repository, :url => remove_project_platform_repository_path(@platform, @repository), :html => { :class => :form } do |f|
= form_for :repository, :url => remove_project_platform_repository_path(@platform, @repository), :method => :delete, :html => { :class => :form } do |f|
.leftlist= f.label :projects_list
.rightlist= f.text_area :projects_list
.both

View File

@ -192,6 +192,7 @@ Rosa::Application.routes.draw do
resources :repositories do
member do
get :add_project
put :add_project
get :remove_project
delete :remove_project
get :projects_list