directly set the user id attribute
parent
9bb9e73e6e
commit
6af005cf94
|
@ -25,7 +25,7 @@ class Photos < Application
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@photo.user = current_user
|
@photo.user_id = current_user.id
|
||||||
if @photo.save
|
if @photo.save
|
||||||
flash[:notice] = 'Great success'
|
flash[:notice] = 'Great success'
|
||||||
redirect url(:photo, @photo)
|
redirect url(:photo, @photo)
|
||||||
|
|
Reference in New Issue