370 Experience
0 Lessons Completed
0 Questions Solved


Posted in sending the simplest of emails? (ruby or RoR)

Am I missing something very basic, what does it take for me to send a simple email with 'hello' to my personal inbox in ruby (or Rails)
in php it's this simple : mail("[email protected]","My subject",$msg);

I know php has to be running from a server to able to do anything, but what would I need to get the equivalent in ruby (or rails?) from my local computer?

I tried the Rails Guides Action mailer basics only to be rewarded with output in the terminal :(

...or copy and paste the following from https://www.tutorialspoint.com/ruby/ruby_sending_email.htm
with the following code running in a test_email.rb file and execute with $ruby test_email.rb

require 'net/smtp'

message = < From: Private Person
To: A Test User
Subject: SMTP e-mail test

This is a test e-mail message.

Net::SMTP.start('localhost') do |smtp|
smtp.send_message message, '[email protected]', '[email protected]'

Returns this :
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/net/smtp.rb:539:in `initialize': Connection refused - connect(2) for "localhost" port 25 (Errno::ECONNREFUSED)

(Can that only run from a server?)

Posted in Upgrade strategy from Rails 4.2.4 to

Background :
I started learning ruby & rails back in 2016. Built a fairly decent project as a self-learning project. Got busy with other stuff and didn't touch ruby or rails until this December. Got some basic tutorial projects going, but was curious on upgrading my old project that was built with Rails 4.2.4 (Ruby 2.3.0).
I would like to bring it up to Rails as all my other tutorial & learning projects are using that version.
One part of the challenge would be to force me to start writing Mini Tests as that would be a life saver when it comes to checking if the app still works at current newly upgraded version and/or where it breaks.

Should I upgrade step by step?
from 4.2.4 to last 4.x.x version (, then, then
Or should I just go from 4.2.4 to directly?

Posted in RSpec w/capybara vs Mini Test

Can anybody recommend any good tutorials/books/videos with Mini Test that are meant for beginners to rails (and ruby)?
I personally prefer videos, but mini test seem to be such a rarity I'll take anything I can get.

Beginner, playing around with Rails 6.0.

I would like to allow the admin of a Rails site to change the site for all anonymous users who come to it:
Settings like
-how many articles per page while using pagination
-color scheme (primary & secondary colors)
-additional navigation links that are static/absolute.
-landing page greeting text and default background image.
-contact email and pre-filled in content in that email link.

I know this can be created and saved in the database, but is it not wasteful of requesting the DB for every page to send request for all examples above, when they will most likely remain the same for long stretches of time, but still allows the admin to update the image once per season, and maybe update the greetings text twice a year, change contact email once per 3 years, etc...
Note: the DB would still be used for the typical, article CRUD's

Is there a built in hash that's a part of the rail framework, not the db, that the views or controllers can access and also be updated by the logged-in admin? If not, would it be possible to add one?

If it's possible, but a bad idea, why? (security hole?)
Is this what writing rails as an api app is more suitable for?

Am I just a beginner who's trying to lookout for wasted resources that in the real world comes down to minimal waste/requests that is fully normal and expected?

Thanks in advance for any learning on why this is bad/smart/dumb/possible/impossible within the Rails framework.

Posted in Is there a beginners course?

As a current beginner/student of rails I'll suggest my current (and 2nd attempt) at Rails:
I Find that most (not all) courses tries to jam in as much Ruby in in an often too short or too intensive block to get to Rails faster.
To avoid that I got a Ruby only course and a course that focuses on Rails.
I am a big fan of video tutorials so I if that's your preferred style I got at udemy (I always buy when they run discounts)

for rails : https://www.udemy.com/course/the-complete-ruby-on-rails-developer-course/
for ruby : https://www.udemy.com/course/learn-to-code-with-ruby-lang/

I discovered that I also need to learn Web packer, and I got some courses on that, but I haven't had a chance to start them, and I'm not 100% sure they are good, so I'll keep quiet on that end until I have started on any of them.

However, I would say that I've only heard good stuff about the Odin project, and Hartl's a great author, so if that learning style is more your jam, follow Red's links.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.