Ask A Question

Notifications

Youโ€™re not receiving notifications from this thread.

Conditionals in Ruby Discussion

Discussion for Conditionals in Ruby

Feels a bit basic, but maybe that's a sign that I'm not exactly a beginner.

Reply

Basic is the idea here ๐Ÿ˜… but you're probably also correct in your knowledge self-assessment, Daniel. That's great if that is the case!

Reply

Great video Collin, thanks for the time and effort put into this (and all the others!)

Reply

Thanks a bunch! I'm glad you are enjoying them all!

Reply

great videos, thanks Collins your the best.

Reply

if you wanted to add another service in the PASSWORD_VAULT, would that be a nested hash right? how would that look?

Reply

Hey Marissa,

Yep exactly right! The hash itself would look something like this:

PASSWORD_VAULT = {
  "service one" => {
    "username" => "Collin",
    "password" => "supersecret"
  },
  "service two" => {
    "username" => "other_collin",
    "password" => "supersupersecret"
  }
}
Reply

Nice job Collin! I like the use of 'hash' manipulations within the conditional examples! : )

Reply

Hey Collin, thanks!
I remember to have seen a one line if statement that evaluates only one thing, for instance if this is not true do this, without providing else. Is that possible or I am mixing languages up?

Reply

Hey Alessandro,
You can absolutely do just a single if without an else clause in it. You have two forms that you can write such conditionals. The first is the traditional style, for example:

if true
  puts "Hello, world!"
end

The second being the modifier form, which allows you to write such conditionals on a single line like so:

puts "Hello, world!" if true

Hope that helps!

Reply

Thanks ๐Ÿ˜ƒ

Reply

The Ruby extension in the video is now deprecated. VSCode recommends Ruby LSP from Shopify. Do you recommend that as well now or something else?

Reply

I would also recommend the Ruby LSP from Shopify if you're going to be using VSCode. They are putting a lot of work into that and it seems that that work is only going to continue and the extension become better and better.

Reply

This was really cool. I loved this. Seems like it was perfect timing and fit nicely with the rest of the stuff. Really pus everything we've learned into the proper perspective. Too many teaching platforms only show you snippets and not a full program but I think that is literally what has left too many gaps and questions in my learning making me have to forever try to keep digging up more info until I could piece it all together myself, which as you could probably imagine, just was not happening!! Putting this together beginning to end did the trick. Real word examples of a full program with working code. Awesome. Thank you so much for this. I can't wait to get my hands dirty in the rest of the course and all the Rails courses this site offers. If all he other material is like this one I am sure I will learn a lot.

Reply

Hey Jessica! Thank you so much for the extremely kind words regarding this lesson! Your comment made my day and I'm very happy to hear that showing things in the context of an actual project really made it click for you. As we add more lessons to this path, I will keep this in mind and try to continue showing and exploring concepts in this way.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,796+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.