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
|
||||
def create
|
||||
@software = Software.find(params[:software_id])
|
||||
@repository = GithubRepository.new(params.permit(:name, :software_id))
|
||||
@repository.save
|
||||
|
||||
if @software.id == params[:repository][:software_id].to_i
|
||||
@repository = GithubRepository.new(params.require(:repository).permit(:software_id, :name))
|
||||
@repository.save
|
||||
end
|
||||
|
||||
redirect_to edit_software_path(@software)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue