Skip to content

Instantly share code, notes, and snippets.

View AquisTech's full-sized avatar
💻
Speaking via <code/>

AquisTech AquisTech

💻
Speaking via <code/>
View GitHub Profile
@AquisTech
AquisTech / model_sequence.rb
Last active November 15, 2020 03:48
Order of elements arrangement in Model
# encoding
class ModelName < ApplicationRecord
# require statements
# extend Modules
# include Modules
# Gem/Plugins options
# CONSTANTS
# Attribute accessors
# serialize attributes
## API
* http://apionrails.icalialabs.com/book/chapter_one
* https://medium.com/statuscode/introducing-webpacker-7136d66cddfb#.9aou0hodw
* https://blog.codeship.com/building-a-json-api-with-rails-5/
* http://blog.arkency.com/2016/02/how-and-why-should-you-use-json-api-in-your-rails-api/
* https://github.com/tiagopog/jsonapi-utils
* https://robots.thoughtbot.com/validating-json-schemas-with-an-rspec-matcher
* https://github.com/interagent/heroics
* http://weblog.rubyonrails.org/2017/2/23/Rails-5-1-beta1/
* http://blog.michelada.io/whats-new-in-rails-51

Realtime Notifications with ActionCable

In this episode we're going to be adding realtime notifications into your app using ActionCable. We've talked about notifications a few times in the past and we used AJAX polling for that. 95% of the time, polling is the solution that would be recommended for it.

But if you're looking for a good introduction into ActionCable then this is a decent one because we're only really using it for one way from the server side to the client side.

Getting started

So to get started we're starting with an app that has Bootstrap installed and then we created a Main controller with an index view which is where we will list our Notifications as for this example.

Before we generate our channels let's install a few things

@mdang
mdang / RAILS_CHEATSHEET.md
Last active November 28, 2025 10:01
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do