Auto-fill personal profile from other conference
This commit is contained in:
parent
ff00f63b7c
commit
e762acebfb
|
@ -26,18 +26,18 @@ module Management
|
|||
|
||||
def new
|
||||
@conference = find_conference
|
||||
@profile = @conference.participant_profiles.
|
||||
build(user_id: params[:user_id])
|
||||
@user = User.find params[:user_id]
|
||||
@profile = @user.build_personal_profile(@conference)
|
||||
end
|
||||
|
||||
def create
|
||||
@conference = find_conference
|
||||
@profile = PersonalProfile.new(profile_params)
|
||||
@profile.conference = @conference
|
||||
@user = User.find(profile_params[:user_id])
|
||||
@profile = @user.build_personal_profile(@conference, profile_params)
|
||||
|
||||
if @profile.save
|
||||
flash[:notice] = 'Profile was successfully created.'
|
||||
redirect_to action: :index
|
||||
flash[:notice] = t('.successfully_created')
|
||||
redirect_to management_conference_personal_profile_path(@profile, conference_id: @conference.id)
|
||||
else
|
||||
render action: :new
|
||||
end
|
||||
|
|
|
@ -4,6 +4,8 @@ bg:
|
|||
index:
|
||||
no_profile: 'Този потребител няма въведен профил за текущата конференция.'
|
||||
total: "%{current} от общо %{total}"
|
||||
create:
|
||||
successfully_created: "Профилът беше създаден успешно."
|
||||
conferences:
|
||||
show:
|
||||
summary: 'Обобщение'
|
||||
|
|
Loading…
Reference in New Issue