- Models, Views, Controllers (MVC)
- Data Structures & Relationships
- Routings
- Migrations
- Views with forms, partials, helpers
- RESTful design
- Adding gems for extra features
- Start Rails app => 'rails new blogger'
- Configuring the Database (config/database.yml)
- Starting the Server => 'bin/rails server'
- Creating the Article Model => 'bin/rails generate model Article'
- Working with the Database (db/migrate/20180123020745_create_articles.rb)
- Saving the Migration => 'bin/rake db:migrate'
- Working with a Model in the Console => 'bin/rails console' ('Article.all', 'Article.new')
- Looking at the Model (app/models/article.rb)
- Setting up the Router (config/routes.rb)
- Looking at the Routing Table => 'bin/rake routes'
- Creating the Articles Controller => 'bin/rails generate controller articles' (app/controllers/articles_controller.rb)
- Defining the Index Action (app/controllers/articles_controller.rb)
- Creating the Index View (app/views/articles/index.html.erb)
- Adding Navigation to the Index
- Defining the Show Action (app/controllers/articles_controller.rb)
- Creating the Show View (app/views/articles/show.html.erb)
- Styling (app/assets/stylesheets/screen.css)
- Defining the New Action (app/controllers/articles_controller.rb)
- Creating the New View (app/views/articles/new.html.erb)
- Defining the Create Action to process user response from form in New View (app/controllers/articles_controller.rb)
- Defining article_params helper method to use Strong Parameters. (app/helpers/articles_helper.rb)
- Including ArticlesHelper to controller class and using our helper method as a parameter inside new.
- Defining the Edit Action (app/controllers/articles_controller.rb)
- Creating the Edit View (app/views/articles/edit.html.erb)
- Creating a Form Partial (_form.html.erb) for new.html.erb and edit.html.erb
- Defining Update Action (app/controllers/articles_controller.rb)
- Adding Flash (app/controllers/articles_controller.rb)
- Adding Flash to the Layout (app/views/layouts/application.html.erb)
- Configurating root to show articles index page (config/routes.rb)
- Creating the Comment Model => 'bin/rails generate model Comment author_name:string body:text article:references'
- Saving the Migration => 'bin/rake db:migrate'
- Setting up the one to many connection between article and comment models (app/models/article.rb, app/models/comment.rb)
- Testing in rails console => 'bin/rails console'
a = Article.first a.comments Comment.new a.comments.new a.comments
c = a.comments.new c.author_name = "Daffy Duck" c.body = "I think this article is thhh-thhh-thupid!" c.save d = a.comments.create(author_name: "Chewbacca", body: "RAWR!")
a.reload a.comments 34. Displaying Comments for an Article (app/views/articles/show.html.erb) 35. Creating partial _comment.html.erb for randering comments (app/views/articles/_comment.html.erb) 36. Creating a Comment Form Partial (app/views/comments/_form.html.erb, app/views/articles/show.html.erb) 37. Configurating routes to specify comments as a sub-resource (config/routes.rb) 38. Generating Comments Controller 'bin/rails generate controller comments' 39. Defining Create Action with comment_params method for Comments Controller (app/controllers/comments_controller.rb) 40. Tagging => 'bin/rails generate model Tag name:string', 'bin/rails generate model Tagging tag:references article:references' 41. Saving Migration 'bin/rake db:migrate' 42. Expressing Relationships (app/models/article.rb, app/models/tag.rb) 43. An Interface for Tagging Articles (app/views/articles/_form.html.erb) 44. Defining tag_list method in Article model (app/models/article.rb) 45. Overriding to_s method in Tag model (app/models/article.rb) 46. Defining tag_list setter method in Article model (app/models/article.rb) 47. Generating Tags Controller => 'bin/rails generate controller tags' 48. Setting routes for tags (config/routes.rb) 49. Defining Show Action (app/controllers/tags_controller.rb) 50. Creating Show View (app/views/tags/show.html.erb) 51. Setting up the Database for Paperclip => 'bin/rails generate migration add_paperclip_fields_to_article' 52. Add columns to Articles table (db/migrate/20180130101826_add_paperclip_fields_to_article.rb) 53. Save migration => 'bin/rake db:migrate' 57. Adding Paperclip's 'has_attached_file' method to the Article Model (app/models/article.rb) 58. Modify app/helpers/articles_helper.rb => permit(..., :image) 59. Modify the Form Template (app/views/articles/_form.html.erb) 60. Modify the Show Template to render image (app/view/articles/show.html.erb) 61. Multiple files upload with nested resource using Paperclip in Rails. 62. Authentication with Sorcery => 'bin/rails generate sorcery:install --model=Author' 63. Adding username to migration file (db/migrate/*_sorcery_core.rb) 64. Saving the migration => 'bin/rake db:migrate' 65. CRUD for our Author Model using rails scaffold_controller generator => 'bin/rails generate scaffold_controller Author username:string email:string password:password password_confirmation:password' 67. Improving authors/_form.html.erb 68. Improving Author Model by adding password matching confirmation => (app/models/author.rb) 69. Improving authors/index.html.erb 70. Adding authors resources (config/routes.rb) 71. Improving application layout to display login status (app/views/layouts/application.html.erb) 72. Generatin AuthorSessions controller for Logging in => 'bin/rails generate controller AuthorSessions 73. Adding new, create, destroy actions to app/controllers/author_sessions_controller.rb 74. Creating New View => (app/views/author_sessions/new.html.erb) 75. Editing routes to handle our logging in => (config/routes.rb) 78. Securing New Users (app/controllers/authors_controller.rb) 79. Securing the rest of app (app/controllers/authors_controller.rb,tags_controller.rb, comments_controller.rb, articles_controller.rb) 80. Hiding links from unauthenticated users (app/views/articles/show.html.erb)