Commit 382ad0462322959728da2acf9f9eb3e93149fe5e
Committed by
Rafael Manzo
1 parent
d18a1144
Exists in
colab
and in
4 other branches
removing repository is working, editing view is rendered but not saved
Showing
2 changed files
with
5 additions
and
3 deletions
Show diff stats
app/controllers/repositories_controller.rb
| ... | ... | @@ -25,6 +25,8 @@ class RepositoriesController < ApplicationController |
| 25 | 25 | # GET /repositories/1/edit |
| 26 | 26 | def edit |
| 27 | 27 | @project = Project.find(params[:project_id]) |
| 28 | + set_repository | |
| 29 | + @repository_types = KalibroEntities::Entities::Repository.repository_types | |
| 28 | 30 | end |
| 29 | 31 | |
| 30 | 32 | # POST /repositories |
| ... | ... | @@ -68,7 +70,7 @@ class RepositoriesController < ApplicationController |
| 68 | 70 | @project = Project.find(params[:project_id]) |
| 69 | 71 | @repository.destroy |
| 70 | 72 | respond_to do |format| |
| 71 | - format.html { redirect_to project_repositories_path(@project) } | |
| 73 | + format.html { redirect_to project_path(@project) } | |
| 72 | 74 | format.json { head :no_content } |
| 73 | 75 | end |
| 74 | 76 | end |
| ... | ... | @@ -76,7 +78,7 @@ class RepositoriesController < ApplicationController |
| 76 | 78 | private |
| 77 | 79 | # Use callbacks to share common setup or constraints between actions. |
| 78 | 80 | def set_repository |
| 79 | - @repository = Repository.find(params[:id]) | |
| 81 | + @repository = Repository.find(params[:id].to_i) | |
| 80 | 82 | end |
| 81 | 83 | |
| 82 | 84 | # Never trust parameters from the scary internet, only allow the white list through. | ... | ... |
app/views/repositories/edit.html.erb