null
US
Sign In
Sign Up for Free
Sign Up
We have detected that Javascript is not enabled in your browser. The dynamic nature of our site means that Javascript must be enabled to function properly. Please read our
terms and conditions
for more information.
Next up
Copy and Edit
You need to log in to complete this action!
Register for Free
4274165
Wiki App
Description
Mind Map on Wiki App, created by joshuazap on 06/01/2016.
No tags specified
rails
Mind Map by
joshuazap
, updated more than 1 year ago
More
Less
Created by
joshuazap
almost 9 years ago
8
0
0
Resource summary
Wiki App
Users
data Model
Devise
:confirmable
:database_authenticatable
:registerable
:recoverable
:rememberable
:trackable
:validatable
have and belong to many wikis (through collaborators)
validates :username (string), presence: true
id (integer)
app/models/user.rb
def collaborators: Collaborator.where(user_id: id)
def wikis: collaborators.wikis
Controller
View
Wikis
data Model
default_scope { order(:title ASC' }
validates :body (string/markdown), presence: true
validates :private (boolean), presence: true
default t.boolean :private
validates :title (string), presence: true
id (integer)
has many users through collaborators
app/models/wiki.rb
has_many :collaborators
def users: collaborators.users
delegate :users, to: collaborators
belongs to user (user that created it)
Controller
index, show, new, create, destroy
private: def wiki_params
View
Private wikis
visible to: admins, @wiki.user, @wiki.collaborator
Public wikis
visible to: everyone
Application Controller
before_action :authenticate_user!
Collaborators
data Model
user_id (integer)
wiki_id (integer)
id (integer)
app/models/collaborator.rb
def self.wikis: Wiki.where( id: pluck(:wiki_id) )
def self.users: User.where( id: pluck(:user_id) )
def wiki: Wiki.find(wiki_id)
def user: User.find(user_id)
Show full summary
Hide full summary
Want to create your own
Mind Maps
for
free
with GoConqr?
Learn more
.
Similar
Bloc testing
Sanny Lin
Jekyll and Hyde
elliesussex
Cell Structure
daniel.praecox
OCR AS Biology - Lipids
Chris Osmundse
GCSE AQA Citizenship Studies: Theme 1
I Turner
A-level Maths: Key Differention Formulae
Andrea Leyden
AQA Biology B1 Questions
Bella Statham
GCSE AQA Chemistry Atomic Structure and Bonding
mustafizk
Forms of Business Ownership Quiz
Noah Swanson
Pathos in Battle
mouldybiscuit
Salesforce Admin 201 Test Chunk 4 (91-125)
Brianne Wright
Browse Library