Creating your first Ruby
on Rails application
Prerequisites
• Install Rails and all requirements from
http://railsinstaller.org/en
• Create an account at http://github.com
• Windows users, install Ruby 1.9+
• Mac users, you also get RVM. I’ll mention
that later.
• Sorry Linux, no Rails install...
Follow the prompts to
install Rails
Once the installer has finished,
it will ask you to log in to your
Github account.
Go for it.
Go for it.
Windows
Install a suitable text editor. I
recommend Notepad++ (
http://notepad-plus-plus.org/)
Open CMD.exe
• Go to start menu, type ‘CMD’ and press
enter. It should open the command prompt
for you.
Create a new folder for
your work
• And put it somewhere nice, I tend to go for
C:rails
Navigate there
• In CMD, type
cd C:rails
• Replace C:rails with the path to
wherever you created your previous folder.
From the start menu,
open Git Bash
cd ~/.ssh
ssh-keygen -t rsa -C "your_email@example.com"
When prompted for
location, just press
enter to accept the
default. Do the same
for the encryption key,
also.
clip < ~/.ssh/id_rsa.pub
Then go to
Github.com, and open
settings.
(2nd icon from top right)
(2nd icon from top right)
Now, on the left side,
select SSH keys.
Click ‘Add SSH key’.
For name, chose an
appropriate name for
your key. Mine is Benji-
mac.
right click paste. The
previous command
(clip < ~/.ssh/id_rsa.pub)
added the key to your
clipboard.
added the key to your
...
Click ‘Add key’. You
should also receive an
email telling you a key
has been added.
Mac OSX 10.6+
Install a suitable text editor.
I recommend TextMate (
http://macromates.com/)
Open Terminal
• Go to Spotlight Search (cmd + space) and
type ‘terminal’. It should be there.
cd ~/.ssh
ssh-keygen -t rsa -C "your_email@example.com"
When prompted for
location, just press
enter to accept the
default. Do the same
for the encryption key,
also.
pbcopy < ~/.ssh/id_rsa.pub
Then go to
Github.com, and open
settings.
(2nd icon from top right)
(2nd icon from top right)
Now, on the left side,
select SSH keys.
Click ‘Add SSH key’.
For name, chose an
appropriate name for
your key. Mine is Benji-
mac.
right click paste. The
previous command
(clip < ~/.ssh/id_rsa.pub)
added the key to your
clipboard.
added the key to your
...
Click ‘Add key’. You
should also receive an
email telling you a key
has been added.
Create a new folder for
your work
• And put it somewhere nice. I tend to go for
[username]/rails
Navigate there
• In terminal, type
cd ~/rails
• The ~ (tilde character) in this represents
your home directory.
Optional
• RVM stands for RailsVersion Manager. It’s
very useful if you’re using various versions
of Ruby, such as MacRuby...
The brief
• You have been asked to create an online
management system for a pet shop,“Jones’
Pets”.
• The system must, for now, keep...
Getting started
rails new pet-shop
Run this command in
Terminal (Mac), or
CMD (Windows)
• This will create a new folder in your rails
folder, called ‘pet-shop’
• Inside this folder, rails will have generated
ev...
Let’s have a look inside
• app/
• assets/
• images/
• rails.png
• javascripts/
• application.js
• stylesheets/
• application.css
• controllers/
• a...
I’ve left some out
there.
But it still looks a little
scary, right?
But it still looks a little
scary, right?
You don’t need to
know what all of it
does.
A lot of the directories are
empty, and will stay that
way through the tutorial.
Here are some of the
important ones
app/
• This is where we will be spending most of
our time. It contains [nearly] all of the files
that we need to make our appli...
app/assets/
• This is where you will find all the resources for
the app.
• This includes:
• CSS
• Javascript
• & images
• Don’t worry ...
app/controllers/
• A Rails controller interprets a request from
the browser, and then tells the application
what to do.
• eg., if you visit...
app/helpers/
• This contains the code that bridges the
controller and the view.These can be
written directly in the view, but helpers
k...
app/mailers/
• These allow you to send emails from your
application.We won’t be needing these.
app/models/
• Models hold associations and code relating
to the database. Note: it does not actually
contain the database.
app/views/
• This file contains all the layout information
for the application.
• Note, it contains NO styling information.
app/view/layouts/
• This contains the templates from the
templates from which pages are loaded
into.
• application.html.erb is the default.
...
Gemfile
• The Gemfile (no extension) contains a list
of ‘Gems’ (or plugins) your application
requires, for Bundler to install.
public/
• This contains pages with no dynamic or
generated content.
• If your website contains a lot of static
pages, it is unlike...
/README.rdoc
• This file contains information about your
project. It’s not really needed, but because
we are going to useGitHub, we sha...
/test/
• This will contain tests for our projects.
• We will not use anything currently in this
directory, as we shall use RSPEC.
Introduction to Git
What is Git?
• Git is a distributed version control system, used
for tracking changes to code to allow roll-backs
and secu...
• Firstly, open an internet browser, and go to
http://github.com
• You should have created an account at the
beginning of ...
Creating a new
repository
• Create a new repository
(repo) using the third icon on
the right at the top-right of
the page.
• It looks like a book wi...
• For the name, I suggest
pet_shop, or
something equally
memorable and relevant.
• You may, optionally, add a
relevant des...
Congratulations, you
just created your first
remote repository.
Let’s put something in it.
Let’s put something in it.
Firstly, you must
initialise your local
repository.
• You can do this in Terminal or CMD by
navigating to your project folder, if you’re
not already there, use
cd C:railspet_...
• Then type git init to initialise the local
repository.
But Git still thinks the
repository is empty,
despite having files
there.
• Let’s fix that.
• In terminal, now run git add .
(Don’t forget that trailing full stop!)
• It may look like nothing has ...
Now you must commit
your changes.
• All committing does, is tells your repository
that the files you listed in the last step have
changed, and you wish for ...
• To commit your changes, you must run
git commit -m “initial
commit”
• The -m tells the command that the name
of the comm...
We’re now almost
ready to push our files
up to Github.
run git push to
push our files
Okay, it’s not meant to
work yet. We haven’t
told our computer
where to push it.
If you still have Github
open, you should see it
has given you some
code.
If you do not still have
Github open, please
return there, and once
logged in, select the
repository we created
earlier, f...
We’re only interested
in the two lines
following, “Push an
existing repository
from the command
line”.
git remote add origin
git@github.com:
[username]/pet_shop.git
git push -u origin master
Note, you need to
change [username] to
whatever your Github
username is.
If you have named your
repository something
other than pet_shop,
you will also need ot
change that in the
command.
The first command
adds a new remote
repository to the
working directory, and
names it ‘origin’.
The second command
sets the default push to
that remote repository.
The -u flag sets the
upstream to a remote
named ‘origi...
Now lets have a look at
our project on Github.
(http://github.com/[username]/pet_store)
)
If it has all worked
properly, you should
see your list of files,
with a long, unrelated
README at the
bottom.
Let’s make it a little
more relevant.
Let’s rename it to
README.md
git mv README.rdoc README.md
This renames the file
README.rdoc (Ruby
doc), to README.md
(Markdown).
Prefixing the mv
command with git
allows git to track the
change.
Now open
README.md
to open with TextMate, or
edit README.md
to open with
TextWrangler.
to open with
TextWrangler.
to open with
TextWrangler.
...
In Windows, you can add Notepad+
+ to your $PATH, but I’ll let Google
explain that one for you.
If this doesn’t take your ...
Once open, clear the
document. We don’t
really need any of it.
Now add something
descriptive. Mine is
shown on the next
slide.
Compiles to
You can find more
information about the
formatting, here
http://daringfireball.net/projects/markdown/basics
http://daringf...
Now you must commit
your change.
Because you have already
alerted git of the new file
by using git mv, you
don’t need to use git
add . again. You can
just ...
The new flag, -a, tells
git to just commit any
file that has been
changed, that has
already been marked by
git, using git ...
Gemfile
Open the Gemfile from
the root of your
application. On Windows,
right-click < Open With
Notepad++, or on Mac
from the comm...
add the following to
the bottom of the file
group :development, :test do
gem 'rspec-rails'
end
end
end
Now, from terminal,
install this by running
bundle update
then
bundle install
bundle install
bundle install
It may take a while.
You need to initiate
Rspec before you can
use it, so run
rails generate rspec:install
rails generate rspec:install
Now commit your
changes.
git commit -am “Updated Gemfile”
Branching
Branching is the act of
diverging away from your
main Git record, for safety.
For example, I might want to
try something n...
git checkout -b pets_controller
checkout changes branches,
whilst -b creates a new branch on
the fly. It’s important to note that
you can go between branc...
Now, to generate a
controller to control
our pets.
Controller. This is the name
for how the database and
webpage interact. It’s a little
more in depth than that, but I
will ...
rails generate resources Pets
animal:string price:integer
quantity:integer
(All one line.)
(All one line.)
Might take a minute, but you will see the output
on the console. Now would be a good time to
add and commit these files.
g...
You can see the routes
created by running
rake routes from
the terminal.
You will see output
along the lines of...
[pet-shop(pets_controller)]$ rake routes
pets GET /pets(.:format) pets#index
POST /pets(.:format) pets#create
new_pet GET ...
If you don’t know what
this means yet, that’s
okay. You will find out
a bit more, shortly.
open
app/controllers/pets_co
ntroller.rb
Once more, you can open this with your text editor.
Once more, you can open this ...
Now, before the line
end,
add...
add...
def index
end
end
This defines a
procedure named
‘index’.
The index is the default route,
and the action that would run if
you went to [your
website]/pets if the site was
live.
Now navigate to
app/views/pets, and create
the file index.html.erb
app/views/pets, and create
the file index.html.erb
.erb is the extension
used for embedded
ruby.
In this file, just add the
line
<h1>Hello, world!</h1>
<h1>Hello, world!</h1>
Now save it, and let’s
go see if it worked.
In the terminal run
rails server start
or
rails s
for short.
for short.
for short.
for short.
This will start a web
server, so you can see
your project on your
own computer.
Now in your browser
go to
http://localhost:3000
http://localhost:3000
Welcome aboard
You’re riding Ruby on Rails!
You’re riding Ruby on Rails!
If you see that message,
it means your Ruby
server isn’t up and
running. Give it a
refresh and see if it
works.
You can have a click
around on this page, it
basically just tells you
about your Ruby
environment.
Not very useful. We’ll
...
But now you can head to
http://localhost:3000/pets
http://localhost:3000/pets
You should see the
‘Hello World!’ you
wrote just now.
Congratulations!
You have created your
first working controller!
You have created your
first working controller!
First app
First app
First app
First app
Upcoming SlideShare
Loading in …5
×

First app

222 views
170 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
222
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

First app

  1. 1. Creating your first Ruby on Rails application
  2. 2. Prerequisites
  3. 3. • Install Rails and all requirements from http://railsinstaller.org/en • Create an account at http://github.com
  4. 4. • Windows users, install Ruby 1.9+ • Mac users, you also get RVM. I’ll mention that later. • Sorry Linux, no Rails installer for you. Google should help you here. • I will continue to point out differences between operating Systems.
  5. 5. Follow the prompts to install Rails
  6. 6. Once the installer has finished, it will ask you to log in to your Github account. Go for it. Go for it.
  7. 7. Windows
  8. 8. Install a suitable text editor. I recommend Notepad++ ( http://notepad-plus-plus.org/)
  9. 9. Open CMD.exe • Go to start menu, type ‘CMD’ and press enter. It should open the command prompt for you.
  10. 10. Create a new folder for your work • And put it somewhere nice, I tend to go for C:rails
  11. 11. Navigate there • In CMD, type cd C:rails • Replace C:rails with the path to wherever you created your previous folder.
  12. 12. From the start menu, open Git Bash
  13. 13. cd ~/.ssh
  14. 14. ssh-keygen -t rsa -C "your_email@example.com"
  15. 15. When prompted for location, just press enter to accept the default. Do the same for the encryption key, also.
  16. 16. clip < ~/.ssh/id_rsa.pub
  17. 17. Then go to Github.com, and open settings. (2nd icon from top right) (2nd icon from top right)
  18. 18. Now, on the left side, select SSH keys.
  19. 19. Click ‘Add SSH key’. For name, chose an appropriate name for your key. Mine is Benji- mac.
  20. 20. right click paste. The previous command (clip < ~/.ssh/id_rsa.pub) added the key to your clipboard. added the key to your clipboard. added the key to your
  21. 21. Click ‘Add key’. You should also receive an email telling you a key has been added.
  22. 22. Mac OSX 10.6+
  23. 23. Install a suitable text editor. I recommend TextMate ( http://macromates.com/)
  24. 24. Open Terminal • Go to Spotlight Search (cmd + space) and type ‘terminal’. It should be there.
  25. 25. cd ~/.ssh
  26. 26. ssh-keygen -t rsa -C "your_email@example.com"
  27. 27. When prompted for location, just press enter to accept the default. Do the same for the encryption key, also.
  28. 28. pbcopy < ~/.ssh/id_rsa.pub
  29. 29. Then go to Github.com, and open settings. (2nd icon from top right) (2nd icon from top right)
  30. 30. Now, on the left side, select SSH keys.
  31. 31. Click ‘Add SSH key’. For name, chose an appropriate name for your key. Mine is Benji- mac.
  32. 32. right click paste. The previous command (clip < ~/.ssh/id_rsa.pub) added the key to your clipboard. added the key to your clipboard. added the key to your
  33. 33. Click ‘Add key’. You should also receive an email telling you a key has been added.
  34. 34. Create a new folder for your work • And put it somewhere nice. I tend to go for [username]/rails
  35. 35. Navigate there • In terminal, type cd ~/rails • The ~ (tilde character) in this represents your home directory.
  36. 36. Optional • RVM stands for RailsVersion Manager. It’s very useful if you’re using various versions of Ruby, such as MacRuby or JRuby. • Create a gemset using rvm create gemset my-gems • Then use this gemset with rvm 1.9@my-gemset
  37. 37. The brief
  38. 38. • You have been asked to create an online management system for a pet shop,“Jones’ Pets”. • The system must, for now, keep track of what pets are in stock, and how many of each there are. • The system will then be updated to handle employee logins, and include a leaderboard of who has sold the most animals.
  39. 39. Getting started
  40. 40. rails new pet-shop
  41. 41. Run this command in Terminal (Mac), or CMD (Windows)
  42. 42. • This will create a new folder in your rails folder, called ‘pet-shop’ • Inside this folder, rails will have generated everything you need to get started. • Navigate into this folder using cd pet_shop
  43. 43. Let’s have a look inside
  44. 44. • app/ • assets/ • images/ • rails.png • javascripts/ • application.js • stylesheets/ • application.css • controllers/ • application_controller.rb • helpers/ • application_helper.rb • mailers/ • models/ • views/ • layouts/ • application.html.erb • config/ • ... • routes.rb • ... • Gemfile • public/ • ... • index.html • README.rdoc • ... • test/ • ... • ...
  45. 45. I’ve left some out there. But it still looks a little scary, right? But it still looks a little scary, right?
  46. 46. You don’t need to know what all of it does.
  47. 47. A lot of the directories are empty, and will stay that way through the tutorial.
  48. 48. Here are some of the important ones
  49. 49. app/
  50. 50. • This is where we will be spending most of our time. It contains [nearly] all of the files that we need to make our application work.
  51. 51. app/assets/
  52. 52. • This is where you will find all the resources for the app. • This includes: • CSS • Javascript • & images • Don’t worry about what each of these do, for now. I’ll get to them soon enough.
  53. 53. app/controllers/
  54. 54. • A Rails controller interprets a request from the browser, and then tells the application what to do. • eg., if you visit http://twitter.com/BenjaminBoxler,Twitter probably uses a controller routing my username to a ‘show’ action in order to display my timeline. • Fun fact:Twitter was originally built in Ruby on Rails, and parts of it reman so.
  55. 55. app/helpers/
  56. 56. • This contains the code that bridges the controller and the view.These can be written directly in the view, but helpers keep things clean and tidy. • helpers in app/helpers/application_helper.rb can be called from any view.
  57. 57. app/mailers/
  58. 58. • These allow you to send emails from your application.We won’t be needing these.
  59. 59. app/models/
  60. 60. • Models hold associations and code relating to the database. Note: it does not actually contain the database.
  61. 61. app/views/
  62. 62. • This file contains all the layout information for the application. • Note, it contains NO styling information.
  63. 63. app/view/layouts/
  64. 64. • This contains the templates from the templates from which pages are loaded into. • application.html.erb is the default. • .erb stands for ‘embedded Ruby’, and means that Ruby can be called directly from that page.
  65. 65. Gemfile
  66. 66. • The Gemfile (no extension) contains a list of ‘Gems’ (or plugins) your application requires, for Bundler to install.
  67. 67. public/
  68. 68. • This contains pages with no dynamic or generated content. • If your website contains a lot of static pages, it is unlikely you would use this. • We will briefly use this in our project.
  69. 69. /README.rdoc
  70. 70. • This file contains information about your project. It’s not really needed, but because we are going to useGitHub, we shall keep it in. • Don’t worry about the extension ‘rdoc’. It stands for Ruby DOCumentation.We will change it to ‘md’ to use Markdown.
  71. 71. /test/
  72. 72. • This will contain tests for our projects. • We will not use anything currently in this directory, as we shall use RSPEC.
  73. 73. Introduction to Git
  74. 74. What is Git? • Git is a distributed version control system, used for tracking changes to code to allow roll-backs and security against corruption. • Created in 2005 for version management of the Linux kernal, by Linus Torvalds, founder of Linux. • Created to make it near impossible for data loss to occur over a distributed network. • For an in-depth look at every aspect of Git, I reccomend reading Pro-Git, available free online.
  75. 75. • Firstly, open an internet browser, and go to http://github.com • You should have created an account at the beginning of this tutorial, so if you have, log in (if you aren’t already), and if not, create an account now.
  76. 76. Creating a new repository
  77. 77. • Create a new repository (repo) using the third icon on the right at the top-right of the page. • It looks like a book with a + on it.
  78. 78. • For the name, I suggest pet_shop, or something equally memorable and relevant. • You may, optionally, add a relevant description. • Click create.
  79. 79. Congratulations, you just created your first remote repository. Let’s put something in it. Let’s put something in it.
  80. 80. Firstly, you must initialise your local repository.
  81. 81. • You can do this in Terminal or CMD by navigating to your project folder, if you’re not already there, use cd C:railspet_shop in Windows, and cd ~/rails/pet_shop on mac.
  82. 82. • Then type git init to initialise the local repository.
  83. 83. But Git still thinks the repository is empty, despite having files there.
  84. 84. • Let’s fix that. • In terminal, now run git add . (Don’t forget that trailing full stop!) • It may look like nothing has happened, but unless you get an error, it has probably worked.
  85. 85. Now you must commit your changes.
  86. 86. • All committing does, is tells your repository that the files you listed in the last step have changed, and you wish for it to take note of it. • In the last step, we didn’t list all the files in the repository, because that would be silly. We used the shorthand,‘.’ (Full stop)
  87. 87. • To commit your changes, you must run git commit -m “initial commit” • The -m tells the command that the name of the commit follows. In this case, the name is “Initial commit”.
  88. 88. We’re now almost ready to push our files up to Github.
  89. 89. run git push to push our files
  90. 90. Okay, it’s not meant to work yet. We haven’t told our computer where to push it.
  91. 91. If you still have Github open, you should see it has given you some code.
  92. 92. If you do not still have Github open, please return there, and once logged in, select the repository we created earlier, from the list on the right.
  93. 93. We’re only interested in the two lines following, “Push an existing repository from the command line”.
  94. 94. git remote add origin git@github.com: [username]/pet_shop.git git push -u origin master
  95. 95. Note, you need to change [username] to whatever your Github username is.
  96. 96. If you have named your repository something other than pet_shop, you will also need ot change that in the command.
  97. 97. The first command adds a new remote repository to the working directory, and names it ‘origin’.
  98. 98. The second command sets the default push to that remote repository. The -u flag sets the upstream to a remote named ‘origin’, on the branch ‘master’.
  99. 99. Now lets have a look at our project on Github. (http://github.com/[username]/pet_store) )
  100. 100. If it has all worked properly, you should see your list of files, with a long, unrelated README at the bottom.
  101. 101. Let’s make it a little more relevant.
  102. 102. Let’s rename it to README.md
  103. 103. git mv README.rdoc README.md
  104. 104. This renames the file README.rdoc (Ruby doc), to README.md (Markdown).
  105. 105. Prefixing the mv command with git allows git to track the change.
  106. 106. Now open README.md
  107. 107. to open with TextMate, or edit README.md to open with TextWrangler. to open with TextWrangler. to open with TextWrangler. to open with
  108. 108. In Windows, you can add Notepad+ + to your $PATH, but I’ll let Google explain that one for you. If this doesn’t take your fancy, you can find the file in Explorer, and right-click > Open with Notepad++ If this doesn’t take your fancy, you can find the file in Explorer, and right-click > Open with Notepad++
  109. 109. Once open, clear the document. We don’t really need any of it.
  110. 110. Now add something descriptive. Mine is shown on the next slide.
  111. 111. Compiles to
  112. 112. You can find more information about the formatting, here http://daringfireball.net/projects/markdown/basics http://daringfireball.net/projects/markdown/basics
  113. 113. Now you must commit your change.
  114. 114. Because you have already alerted git of the new file by using git mv, you don’t need to use git add . again. You can just use git commit -am “Updated README” git commit -am “Updated README”
  115. 115. The new flag, -a, tells git to just commit any file that has been changed, that has already been marked by git, using git add
  116. 116. Gemfile
  117. 117. Open the Gemfile from the root of your application. On Windows, right-click < Open With Notepad++, or on Mac from the command line mate Gemfile
  118. 118. add the following to the bottom of the file
  119. 119. group :development, :test do gem 'rspec-rails' end end end
  120. 120. Now, from terminal, install this by running bundle update then bundle install bundle install bundle install
  121. 121. It may take a while.
  122. 122. You need to initiate Rspec before you can use it, so run rails generate rspec:install rails generate rspec:install
  123. 123. Now commit your changes.
  124. 124. git commit -am “Updated Gemfile”
  125. 125. Branching
  126. 126. Branching is the act of diverging away from your main Git record, for safety. For example, I might want to try something new, but if it doesn’t work I don’t want it to break the project, so I would use a branch.
  127. 127. git checkout -b pets_controller
  128. 128. checkout changes branches, whilst -b creates a new branch on the fly. It’s important to note that you can go between branches, and edit them however, as long as you commit between. You can then merge the branches together, and Git does a good job of doing this automatically - you don’t need to merge any files individually.
  129. 129. Now, to generate a controller to control our pets.
  130. 130. Controller. This is the name for how the database and webpage interact. It’s a little more in depth than that, but I will mention the basics as we go through each part. MVC stands for Model View Controller. This is the name for how the database and webpage interact. It’s a little
  131. 131. rails generate resources Pets animal:string price:integer quantity:integer (All one line.) (All one line.)
  132. 132. Might take a minute, but you will see the output on the console. Now would be a good time to add and commit these files. git add . git commit -m “Generated pets controller.” git commit -m “Generated pets controller.” git commit -m “Generated pets controller.”
  133. 133. You can see the routes created by running rake routes from the terminal.
  134. 134. You will see output along the lines of...
  135. 135. [pet-shop(pets_controller)]$ rake routes pets GET /pets(.:format) pets#index POST /pets(.:format) pets#create new_pet GET /pets/new(.:format) pets#new edit_pet GET /pets/:id/edit(.:format) pets#edit pet GET /pets/:id(.:format) pets#show PUT /pets/:id(.:format) pets#update DELETE /pets/:id(.:format) pets#destroy
  136. 136. If you don’t know what this means yet, that’s okay. You will find out a bit more, shortly.
  137. 137. open app/controllers/pets_co ntroller.rb Once more, you can open this with your text editor. Once more, you can open this with your text editor.
  138. 138. Now, before the line end, add... add...
  139. 139. def index end end
  140. 140. This defines a procedure named ‘index’.
  141. 141. The index is the default route, and the action that would run if you went to [your website]/pets if the site was live.
  142. 142. Now navigate to app/views/pets, and create the file index.html.erb app/views/pets, and create the file index.html.erb
  143. 143. .erb is the extension used for embedded ruby.
  144. 144. In this file, just add the line <h1>Hello, world!</h1> <h1>Hello, world!</h1>
  145. 145. Now save it, and let’s go see if it worked.
  146. 146. In the terminal run rails server start or rails s for short. for short. for short. for short.
  147. 147. This will start a web server, so you can see your project on your own computer.
  148. 148. Now in your browser go to http://localhost:3000 http://localhost:3000
  149. 149. Welcome aboard You’re riding Ruby on Rails! You’re riding Ruby on Rails!
  150. 150. If you see that message, it means your Ruby server isn’t up and running. Give it a refresh and see if it works.
  151. 151. You can have a click around on this page, it basically just tells you about your Ruby environment. Not very useful. We’ll get rid of it in a bit. Not very useful. We’ll
  152. 152. But now you can head to http://localhost:3000/pets http://localhost:3000/pets
  153. 153. You should see the ‘Hello World!’ you wrote just now.
  154. 154. Congratulations! You have created your first working controller! You have created your first working controller!

×