Save user id along with new contacts in order to correctly filter them out via CanCan later on.
This commit is contained in:
parent
b1d4e1afeb
commit
8615cb09aa
1 changed files with 3 additions and 0 deletions
|
|
@ -62,6 +62,9 @@ class ContactsController < ApplicationController
|
|||
end
|
||||
}
|
||||
|
||||
# add the user id for CanCan
|
||||
c.user_id = current_user.id
|
||||
|
||||
if c.save
|
||||
flash[:notice] = 'Kontakt hervorragend angelegt!'
|
||||
redirect_to :action => 'index'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue