Hello!
I am allowing my users to upload files, and it will end up in public
\videos.
How can I ensure that user A can see only his files? Is there a plug
in for this?
Thank You!
Hello!
I am allowing my users to upload files, and it will end up in public
\videos.
How can I ensure that user A can see only his files? Is there a plug
in for this?
Thank You!
assuming everything is setup like this:
Model User:
has_many :videos
Model Videos:
belongs_to :user
somewhere in the session you have stored the logged in user and can
access him with a method like current_user
then in you controller:
current_user.videos.find(params[:id])
or whatever find is necessary
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs