Learn Enough Society
Certificate of Course CompletionThis page certifies that mokubo has completed Ruby on Rails Tutorial! 🎉
Confirmed
200
city
and state
to your current city and state of residence. (If residing outside the U.S., substitute the analogous quantities.)
$ irb
>> city = "San Francisco"
=> "San Francisco"
>> states = "California"
=> "California"
>> puts "#{city}, #{states}"
San Francisco, California
=> nil
>>
puts
) a string consisting of the city and state separated by a comma and a space, as in “Los Angeles, CA”.
$ irb
>> city = "San Francisco"
=> "San Francisco"
>> states = "California"
=> "California"
>> puts "#{city}, #{states}"
San Francisco, California
=> nil
>>
>> puts "#{city}\t#{states}"
San Francisco California
=> nil
>>
Printed nothing
>> puts ""#{city}\t#{states}""
=> nil
>>
>> "racecar".length
=> 7
>>
reverse
method that the string in the previous exercise is the same when its letters are reversed.
>> "racecar".reverse
=> "racecar"
>>
s
. Confirm using the comparison operator ==
that s
and s.reverse
are equal.
>> s = "racecar"
=> "racecar"
>> s == s.reverse
=> true
>>
s
to the string “onomatopoeia”? Hint: Use up-arrow to retrieve and edit previous commands
>> s = "onomatopoeia"
=> "onomatopoeia"
>> s == s.reverse
=> false
>>
"#{:success}"
?
>> flash.each do |key, value|
?> puts "#{:success}"
>> end
success
success
=> {:success=>"It worked!", :danger=>"It faild!"}
>>
OR
>> puts "#{:success}"
success
=> nil
>>
It shows prints value in message types and changes it.
ruby -v
at the command line.
$ ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]
$
$ rails -v
Rails 6.0.3.4
hello
action in Listing 1.13 to read “hola, mundo!” instead of “hello, world!”.
class ApplicationController < ActionController::Base
def hello
render html: "hola, mundo!"
end
end
class ApplicationController < ActionController::Base
def hello
render html: "¡hola, mundo!"
end
end
hello
action in Listing 1.13, add a second action called goodbye
that renders the text “goodbye, world!”. Edit the routes file from Listing 1.15 so that the root route goes to goodbye
instead of to hello
(Figure 1.22).
class ApplicationController < ActionController::Base
def hello
render html: "hola, mundo!"
end
def goodbye
render html: "goodbye, world!"
end
end
heroku help
to see a list of Heroku commands. (If the output of heroku help
doesn’t fit in your terminal window, either scroll up or use heroku help | less
to pipe to the less
command.) What is the command to display logs for an app?
CLI to interact with Heroku
VERSION
heroku/7.47.1 darwin-x64 node-v12.16.2
USAGE
$ heroku [COMMAND]
COMMANDS
access manage user access to apps
addons tools and services for developing, extending, and operating
your app
apps manage apps on Heroku
auth check 2fa status
authorizations OAuth authorizations
autocomplete display autocomplete installation instructions
buildpacks scripts used to compile apps
certs a topic for the ssl plugin
ci run an application test suite on Heroku
clients OAuth clients on the platform
config environment variables of apps
container Use containers to build and deploy Heroku apps
domains custom domains for apps
drains forward logs to syslog or HTTPS
features add/remove app features
git manage local git repository for app
help display help for heroku
keys add/remove account ssh keys
labs add/remove experimental features
local run Heroku app locally
logs display recent log output
maintenance enable/disable access to app
members manage organization members
notifications display notifications
orgs manage organizations
pg manage postgresql databases
pipelines manage pipelines
plugins list installed plugins
ps Client tools for Heroku Exec
psql open a psql shell to the database
redis manage heroku redis instances
regions list available regions for deployment
releases display the releases for an app
reviewapps manage reviewapps in pipelines
run run a one-off process inside a Heroku dyno
sessions OAuth sessions
spaces manage heroku private spaces
status status of the Heroku platform
teams manage teams
update update the Heroku CLI
webhooks list webhooks on an app
$ curl -OL https://cdn.learnenough.com/kitten.jpg
user
to the first user in the database, and verify by calling it directly that the remember
method works. How do remember_token
and remember_digest
compare?
hi
Get free access to all 10 Learn Enough courses (including the Ruby on Rails Tutorial) for 7 days!
We require a credit card for security purposes, but it will not be charged during the trial period. After 7 days, you will be enrolled automatically in the monthly All Access subscription.
BUT you can cancel any time and still get the rest of the 7 days for free!
All Learn Enough tutorials come with a 60-day 100% money-back guarantee.