Redirect to personal profile creation after event creation

This commit is contained in:
Petko Bordjukov 2015-08-15 07:00:34 +03:00
parent d1b3d2cc04
commit 44612e1d52
1 changed files with 9 additions and 1 deletions

View File

@ -17,7 +17,7 @@ module Public
@event.participations.build participant: current_user, approved: true
if @event.save
redirect_to action: :index
after_save_redirect
else
render action: :new
end
@ -32,5 +32,13 @@ module Public
:event_type_id
)
end
def after_save_redirect
if current_user.personal_profile(current_conference).present?
redirect_to root_path
else
redirect_to new_personal_profile_path, alert: I18n.t(:please_fill_in_your_speaker_profile)
end
end
end
end