Skip to content

Instantly share code, notes, and snippets.

View jean-francois-labbe's full-sized avatar
🏠
Working remotly

Jean-Francois Labbé jean-francois-labbe

🏠
Working remotly
View GitHub Profile
@jean-francois-labbe
jean-francois-labbe / comments_channel.rb
Created December 16, 2020 14:24 — forked from dhh/comments_channel.rb
On-boarding a specialized broadcast method in the channel itself
# Channel
class CommentsChannel < ApplicationCable::Channel
def self.broadcast_comment(comment)
broadcast_to comment.message, comment: CommentsController.render(
partial: 'comments/comment', locals: { comment: comment }
)
end
def follow(data)
stop_all_streams
@jean-francois-labbe
jean-francois-labbe / Gemfile
Created December 16, 2020 14:21 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@jean-francois-labbe
jean-francois-labbe / enum.rb
Last active May 9, 2020 08:36
Rails enum
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "activerecord"
@jean-francois-labbe
jean-francois-labbe / Console_input
Created January 16, 2013 13:21
while rspec executes the test 'can see document sections linked to an Aipo' capybara founds the img but the click action does nothing. the page doesn't load. When I use the command prompt to interact with capybara it works si Console_input file
Capybara.find(:xpath,"//img[@alt='viewActor119']").click
# the link is found and the click action opens the web page