mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-15 12:44:03 +00:00
Select Call type when creating; don't switch types.
This commit is contained in:
parent
e518431b8e
commit
75bf1380ba
4 changed files with 22 additions and 14 deletions
|
|
@ -11,7 +11,7 @@ module Admin
|
|||
def show; end
|
||||
|
||||
def new
|
||||
@cfp = @program.cfps.new
|
||||
@cfp = @program.cfps.new(cfp_params_or_first_remaining_type)
|
||||
end
|
||||
|
||||
def edit; end
|
||||
|
|
@ -59,5 +59,11 @@ module Admin
|
|||
def cfp_params
|
||||
params.require(:cfp).permit(:start_date, :end_date, :description, :cfp_type)
|
||||
end
|
||||
|
||||
def cfp_params_or_first_remaining_type
|
||||
cfp_params
|
||||
rescue ActionController::ParameterMissing
|
||||
{ 'cfp_type' => @program.remaining_cfp_types.first }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue