Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

How to handle permission in rails

class Post
  has_many :post_users
  has_many :users, through: :post_users
end

class PostUser
  belongs_to :post
  belongs_to :user
end

class User
  has_many :post_users
  has_many :posts, through: :post_users
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #handle #permission #rails
ADD COMMENT
Topic
Name
1+8 =