fix: params in new github_repository
This commit is contained in:
parent
78a248286f
commit
b9e8dc5ef2
1 changed files with 5 additions and 2 deletions
|
@ -1,8 +1,11 @@
|
||||||
class GithubRepositoryController < ApplicationController
|
class GithubRepositoryController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@software = Software.find(params[:software_id])
|
@software = Software.find(params[:software_id])
|
||||||
@repository = GithubRepository.new(params.permit(:name, :software_id))
|
|
||||||
|
if @software.id == params[:repository][:software_id].to_i
|
||||||
|
@repository = GithubRepository.new(params.require(:repository).permit(:software_id, :name))
|
||||||
@repository.save
|
@repository.save
|
||||||
|
end
|
||||||
|
|
||||||
redirect_to edit_software_path(@software)
|
redirect_to edit_software_path(@software)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue