
Learn how to create a new Rails project with rails new, name your blog, install dependencies from Ruby Gems, and explore the generated app structure.
Explore the Rails project structure, from apps with assets, channels, controllers, models, and views, to gem file, Rails version, database, and config initializers.
Learn Rails' model view controller architecture by exploring how models interact with the database, controllers map requests to actions, and views render HTML, JSON, or JavaScript.
Generate a model named article with title and content attributes, create the corresponding migration, and run migrations to create the articles table in the database.
Learn ruby on rails 7 shows how to create the articles index action by generating a controller, def index, and mapping a get articles route to render the index view.
Set up the root page by defining routes to map the default path to the articles index.
Set the index action to load all articles into a variable and explore the rails console to create articles and query the database, noting nil when none exist.
Practice creating and listing articles in the Rails console, setting article titles and content, and rendering them on the index page using ERB tags with the equal sign.
Explore how the show action retrieves and displays articles by ID, uses the articles show method, renders the template, and handles missing article IDs in Ruby on Rails 7.
Learn to create and link Rails pages with url helpers, using article paths and link_to, and navigate from index to show pages through routes.
Create blog entries in ruby on rails by defining an action in the articles controller, routing articles/new, and building a form with title and content fields to submit an article.
Ruby on Rails 7 demonstrates a create action for articles, using strong parameters to permit title and content, redirecting on success and linking to new article from the index.
Implement the update flow by adding an edit action in the articles controller, loading the article by id, and creating the corresponding edit template linked from the show page.
Extract the edit form into a shared _form.html.erb partial and render it from edit and new views, then implement the update action with strong parameters and proper redirects.
Learn to implement the update action in ruby on rails 7, including patch routes, id-based updates, and redirects to the articles path on success or renders edit on failure.
Learn how to implement a delete action in Ruby on Rails 7 by configuring a route and destroy action, then redirect to the articles index using a delete request button.
Refactor Rails 7 controllers to follow dry principles by introducing a set_article before_action that loads the article by id for show, edit, update, and destroy actions, reducing repetition across actions.
Create an article partial for reuse in Rails views and render it in the index and show pages, using a local article variable.
This lecture demonstrates adding validations to the article model to require a non-blank title and content, preventing blank articles from saving and showing error messages when save fails.
Create a comments model linked to articles, define has_many and belongs_to associations, generate migrations, and wire controllers, routes, and strong params to display and save article comments.
Apply global styling to a Ruby on Rails 7 blog by injecting simple CSS into the application's layout yield area, ensuring all pages share consistent design.
Refactor the code by extracting the comments into a partial, render the comments partial on the show page, and create a form partial for comments to keep views clean.
We recreate a blog application using the scaffold generator to generate controllers, models, views, and routes for articles, then run migrations and explore index, new, edit, and destroy actions.
Sign up with email and password, create rooms with capacity, then create bookings by selecting a room, setting start and end times, and purpose, with sign out.
Initialize a new rails 7 application named appointment by running rails new appointment, install dependencies, navigate into the appointment directory, and open Visual Studio Code with code .
Learn to scaffold a room model with name and capacity, migrate the database, then generate a rooms controller and corresponding views to enable room appointments or bookings.
Create the rooms index action and index view to list all rooms by name, set up restful routes with resources, and run the server to view the rooms at localhost:3000.
Learn Ruby on Rails 7 teaches building a rooms show page with the show action, using a before_action to set the room by id and display its name and capacity.
Creates a rooms new action page that renders a form to create a new room, using a partial for the form with name and capacity fields and a submit button.
Create Rails create action in the rooms controller, enforce strong parameters for name and capacity, respond to HTML, JS, and JSON, and redirect on success while rendering errors on failure.
Update the room through the rooms controller using strong parameters, then redirect to the show page with a success notice, or render edit on failure with flash alerts.
Define destroy action to delete a room by its id, redirect to rooms index, and show 'room was successfully destroyed'; add destroy button using delete method to return to index.
Update the index page to display room capacity and add a link to each room, plus a new room flow that redirects to the newly created room.
Define booking model linked to rooms with start and end datetime, a purpose string, and a room_id reference; generate migrations, and create a bookings controller and routes.
Create the bookings index action, render an index view listing each booking's start time, end time, and purpose, and define the associations: booking belongs_to :room, and room has_many :bookings.
Implement the bookings show action in Ruby on Rails 7, defining a private set_booking method and a before_action for show. Render the show view from views/bookings/show.html.erb.
Learn to implement the edit flow in Rails by defining the bookings controller method, setting the id, and rendering a populated edit form for a booking.
Learn to implement the destroy action in Rails to delete a booking by fetching the record, issuing a delete request, redirecting to the bookings index, and showing was successfully destroyed.
Refactor views to streamline navigation by wrapping content with p tags, adding links between rooms and bookings, and listing available appointments in the rooms show and bookings index.
Install the Devise gem, run bundle install, generate the Devise model and views, migrate the database, and set up routes and turbo streams for sign-up and sign-in.
Add a user_id to bookings via a Rails migration and establish has_many bookings and belongs_to user relationships. Use the Rails console to assign a user_id and verify the association.
Learn how to protect bookings pages by enforcing user authentication in a Ruby on Rails 7 app using a before_action and authenticate_user, ensuring users sign in before viewing.
Learn to associate a booking with the signed-in user in Rails by adding a hidden user id field to the booking form, using current_user, and permitting it in strong parameters.
Add Devise navigation by linking sign in, sign up, and sign out routes, and conditionally display options based on whether the user is signed in.
Add finishing touches by wiring navigation between bookings and rooms, linking their index pages, and enabling users to sign up, create bookings, select rooms, and sign out.
Build a note-taking app with Ruby on Rails 7, enabling sign up and sign in, create, edit, and delete notes, and format text with bold, italics, and bullets.
Install devise in a Rails app by adding the gem, bundling, running rails generate devise:install, generating views and a user model, migrating the database, and configuring flash messages and routes.
Create a Rails model named note with a string title, a user_id integer, and rich text content via Action Text; install Action Text and run rails db migrate.
Create the index action in the controller, set up note variables, render notes in the view with title and content, and start the server to view the /notes index page.
Implement show action in notes controller by fetching a note with its id via a private set_note method and before_action, then render show view displaying the note's title and content.
Create a new note page by initializing a note in the notes controller, rendering a form partial for input fields, including title and a rich text content area, then saving.
Learn how to implement the update action in Rails by locating a note by ID, using strong parameters, handling HTML format, and redirecting to the show page on success.
Learn to clean up the notes interface by extracting a shared partial for rendering each note, reusing it in index and show pages, and generating unique dom IDs.
Define a has many relationship between users and notes, set belongs to on notes, and use current_user with devise to create notes while protecting pages with authenticate_user.
Learn to create notes with the build action in Rails using current_user.notes.build in the console, enabling direct association of notes with the current user and saving them.
Add devise links to the app header for sign in, sign up, and sign out using new_user_session_path, new_user_registration_path, and destroy_user_session_path.
Learn Hotwire in Rails 7, using Turbo Frames and Turbo Streams to build dynamic HTML-driven apps that update the notebook index page, from Rails new to dependencies with Tailwind CSS.
Generate a notes scaffold with title and content fields, run migrations, set the root to notes index, then start the server to view notes on localhost:3000.
Learn to implement turbo frames in Rails 7 to render on-page forms for new and edit actions without navigation, using named frames like new note and new notes.
Learn to update Rails 7 pages with turbo streams by creating a turbo stream view and prepending new notes into the notes container.
Identify the form with a unique id, use a turbo stream replace to render the partial form with a new note, and clear the form after saving.
Learn to edit and update notes on the same page using turbo frame and turbo stream in Rails 7, with ERB views, updating content without duplicates.
Navigate to the show page by replacing the top turbo frame with the desired page, using a turbo frame to correctly redirect from the notes partial.
Delete elements on the page and remove notes dynamically using turbo stream, the destroy action, and turbo frames to reflect changes in real time.
Create a Rails chat application using turbo streams by running rails new, naming it Rails Chat, installing dependencies, and opening the app in Visual Studio Code.
Install Tailwind CSS in a Rails 7 app by running bundle add tailwindcss to add it to the gemfile and install dependencies, then run rails tailwindcss:install to complete the setup.
Generate a scaffold for a room with a name, enabling multi-room chats, install Devise for authentication, and configure routes and migrations.
Run the Rails 7 server and use turbo streams to broadcast room changes to the rooms list, so new rooms appear and edits update in the list.
Generate a scaffold for messages in Rails, define message belongs to a room and a user, migrate databases, and nest messages under rooms in the routes.
Update the rooms controller to require authentication on the show page and render room messages, and adjust the messages controller to load the room by id with a before action.
Render a messages partial in the rooms view, wire the nested messages form to a room, and set hidden room_id and current user id fields.
Learn to broadcast messages in a Ruby on Rails 7 chat app by redirecting to the room show page, simplifying the message partial, and broadcasting updates to the room instantly.
Attach files to Ruby on Rails applications using Active Storage, including single and multiple image uploads. Learn to configure has_one_attached and has_many_attached, update forms, and display uploaded images.
Ruby on Rails 7 is the latest and greatest version of Rails yet! In this course, we will learn the basics of Ruby on Rails and gradually move towards more complex topics. We will build 5 applications through this course, and by the end of the course, you will understand the fundamentals of Rails and how to use the latest features (i.e. Hotwire) in Rails.
First, we will create a Blog web application. Users would be able to create an article, and they would also be able to make comments.
Next, we will create an appointment booking application. Here, users would be able to create rooms and create booking appointments for each room. We will also learn how to authenticate users using Devise.
For the following application, we would create a note-taking application. We would use default Ruby on Rails features to create a powerful note-taking application.
We will then refactor our notebook application. Using Turbo Streams and Turbo Frames, we will make a more dynamic and powerful note-taking application without the inclusion of any additional javascript.
Finally, we would create a real-time chat application. Here, users would be able to visit different chatrooms and have other conversations in each chatroom.