Capstone process outline
- ERD (Entity Relationship Diagrams) using Ideas
- Generate resources w/ scaffolds
a.rails g resource : scaffold...
b.rake db migrate
then RCAV Route, Controller, Action, View - generate user accounts with Devise
- add
gem devise
bundle install
rails g devise:install
- add root route in
routes.rb
i.e.root "photos#index"
- generate
users
tablerails g devise user username name ....
from copilot on Ideas - look at migration file & make edits (i.e. to default values)
rake db:migrate
-
Generate photos/events resources with scaffold
rails g scaffold event...
- check migration file (i.e.
t.references
and default values fort.integrer :likes_count, default: 0
- Check association accessor with correct foreign key column names if applicable
- update migration file to point the foreign key to the correct table i.e.
t.references :owner, null: false, foreign_key: { to_table: :users }
rake db:migrate
- generate other tables (i.e. comments)
- check migration file
- check models i.e.
comment.rb
anduser.rb
-
use Association Accessor app to plan out association accessor methods
-
Associations
Direct associations:belongs_to
&has_many
etc. check Ideas copilot
Indirect Associations
- look at study buddy answer to second degree associations question
Validations
Sample Data
PART 2 – user interface – use ajax here
7 golden actions (autogenerated using resources :movies
in routes.rb
(create, new, index, show, update, edit, destroy)
View templates
Partials: _form.html.erb
_navbar.html.erb
Bootstrap cards
partials i.e. _movie.html.erb
method: .to_partial_path
inherited from ApplicationRecord
class