$ gem install rails -v 5.0.0.beta1 --no-ri --no-rdoc
$ rails _5.0.0.beta1_ new blog --skip-spring
Assumptions: The application already exists. You have two models article.rb
and comment.rb
. Articles have two attributes, title
and text
. Comments have two attributes, text
and article_id
. See these instructions if you need help getting started.
Assuming that you are nesting your :comments
resources inside of :articles
, mount ActionCable
and make sure you have a root.
config/routes.rb
Rails.application.routes.draw do
class Attachment < ActiveRecord::Base | |
mount_uploader :attachment, AttachmentUploader | |
# Associations | |
belongs_to :attached_item, polymorphic: true | |
# Validations | |
validates_presence_of :attachment |
There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.
From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?