Ask LSBot

Our First App

Set Up Starter App

For the first two sections of this book, we'll ask you to build up a blog app to learn Ruby on Rails. To get this started, follow the commands below to clone a starter app:

# make sure to use ruby version 2.6.0

$ git clone https://github.com/launchschool/demystifying_rails_app_template
$ cd demystifying_rails_app_template
$ bundle exec bundle install
$ bundle exec rails server

Once $ bundle exec rails server is running, just point your browser to http://localhost:3000/ to use the app.

Outlining Our First App

So now that we have a fresh Rails app up and running, let's make it respond to an HTTP request.

Specifically, let's say that we want a request from our browser to /hello_world to result in the text Hello, world! being displayed in the browser.

In Rails, this is essentially a two step process:

  1. define where the request should go
  2. define the code to handle a request of this kind

The first of these is accomplished by declaring a route.

The second, by defining a method on a controller. This type of method on a controller containing logic for handling a request is called an action.

In the next several chapters, we'll go through those steps to build up our first Rails app.

This conversation with LSBot is temporary. Sign up for free to save your conversations with LSBot.

Hi! I'm LSBot. I'm here to help you understand this chapter content with fast, focused answers.

Ask me about concepts, examples, or anything you'd like clarified from this chapter. I can explain complex topics, provide examples, or help connect ideas.

Want to know more? Refer to the LSBot User Guide.

This conversation with LSBot is temporary. Sign up for free to save your conversations with LSBot.

Hi! I'm LSBot. I'm here to help you think through this exercise by providing hints and guidance, without giving away the solution.

You can ask me about your approach, request clarification on the problem, or seek help when you feel stuck.

Want to know more? Refer to the LSBot User Guide.