kaiho/app/controllers/github_repository_controller.rb

24 lines
574 B
Ruby
Raw Normal View History

2018-07-29 19:06:32 +00:00
class GithubRepositoryController < ApplicationController
def create
@software = Software.find(params[:software_id])
@repository = GithubRepository.new(repository_params)
@repository.save
redirect_to edit_software_path(@software)
end
def update
@software = Software.find(params[:software_id])
@repository = GithubRepository.find(params[:id])
@repository.update(repository_params)
redirect_to edit_software_path(@software)
end
private
def repository_params
params.require(:repository).permit(:name, :software_id)
end
end