Let's try out your fresh new development environment with your first proper Rails project!
Build software better, together
Begin by clicking the link! After accepting the assignment, select your name from the list. It will generate your personal repository that you can now clone!
git clone <https://github.com/rails-decal/fa19-hw3-your_username.git>
Now run cd fa19-hw3-your_username
to get into the new folder cloned in, and boot it up with rails server
.
Once the server starts up (through rails server
, you should be brought to a blank page: that's okay! This is a very minimal skeleton to help you get started with writing your app. But now, the URL you see in the browser (Most likely looks like localhost:3000
or <long number>.ngrok.io
) is the domain for your web server!
Begin by opening app/views/**main**/**index**.html.erb
. This is the view that is rendered by default by our **main**_controller
's index
method.
Write "Hello World!" inside this file, and try surrounding it with some HTML tags. An example of this is hidden below for your reference.
Now let's try templating our application, so our app doesn't say "Hello world" to everyone.
Instead, if they provide a name parameter with the request, it should say "Hello <name>!" Otherwise it can just say "Hello!"
Remember the rules of ERB (Embedded Ruby):
<%= some ruby expression %>
: Evaluate and place resulting value into view