(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
= semantic_nested_form_for @gallery, multipart: true do |form| | |
= form.input :file_multiple, as: :file, input_html: { multiple: true } | |
= form.actions do | |
= form.action :submit |
# An example demonstrating Gmail API via IMAP using gmail_xoauth gem | |
# Add this file to your rails project to use if you don't want to use this in rails project then require | |
require 'net/imap' | |
require 'gmail_xoauth' | |
class Gmail | |
attr_accessor :email, :access_token | |
def initialize(args) | |
email = args[:email] |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
http://ruby-china.org/topics/16256
get https://github.com/mvj3/hangman/blob/master/data/words.txt
and compile the decision tree.json
ruby compile.rb
def paginate(scope, default_per_page = 20) | |
collection = scope.page(params[:page]).per((params[:per_page] || default_per_page).to_i) | |
current, total, per_page = collection.current_page, collection.num_pages, collection.limit_value | |
return [{ | |
pagination: { | |
current: current, | |
previous: (current > 1 ? (current - 1) : nil), | |
next: (current == total ? nil : (current + 1)), |
source "https://rubygems.org" | |
gem "pg" | |
gem "sqlite3" | |
unless version = ENV["AR"] | |
abort("specify ActiveRecord version with AR. eg: AR=2 bundle install") | |
else | |
gem "activerecord", "~> #{version}", require: "active_record" | |
end |