Commit 4cfb29bc authored by marcheing's avatar marcheing

Add user id and update notice on profile creation

parent 102e17b7
...@@ -26,10 +26,11 @@ class ProfilesController < ApplicationController ...@@ -26,10 +26,11 @@ class ProfilesController < ApplicationController
# POST /profiles.json # POST /profiles.json
def create def create
@profile = Profile.new(profile_params) @profile = Profile.new(profile_params)
@profile.user_id = current_user.id
respond_to do |format| respond_to do |format|
if @profile.save if @profile.save
format.html { redirect_to @profile, notice: 'Profile was successfully created.' } format.html { redirect_to @profile, notice: I18n.t('successfully_created_profile') }
format.json { render :show, status: :created, location: @profile } format.json { render :show, status: :created, location: @profile }
else else
format.html { render :new } format.html { render :new }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment