よちよち.rbで作成しているアプリ(の主にGit操作)と、Railsチュートリアルを進めました。
プルリクエストによる開発の進め方 プルリクエストでレビューを受け、指摘があったときは同一のブランチ上でそれを修正・コミットし、pushする。
1つのプルリクエスト(ブランチ)にはコミットが複数。
Rails Girls ガイド を最初から進めていきました。
Mac OS X 10.9.2
ステップ 3-Bに従って、rbenvを使ってRuby 2.1.2をインストール。
Rails Girls ガイド の復習をしました。
インストール済み:ruby 1.9.3, rbenv, rails 4.1.0
Spring問題で動かず。 RailsでSpringが動かないとき (Mac) [ uninitialized constant Spring::SID::DL ] - tkymtk's blog
# jQuery optgroupDoubleSelect plugin | |
# Rewrite of jDoubleSelect | |
# Copyright (c) Giovanni Casassa & Toru Kawamura | |
# | |
# Dual licensed under the MIT (MIT-LICENSE.txt) | |
# and GPL (GPL-LICENSE.txt) licenses. | |
# | |
# http://www.senamion.com/blog/jDoubleSelect.html | |
jQuery ($) -> |
module ApplicationHelper | |
def render_thumbsup_button(options) | |
options[:url] ||= thumbsup_path | |
options[:method] ||= :put | |
options[:count] ||= 0 | |
# ローカル変数を渡したいときのみ locals が必要 | |
render inline: <<-HAML.strip_heredoc, type: :haml, locals: options | |
.thumbsup | |
= form_tag url, method: method do | |
%button.btn.btn-xs |
/* | |
This widget shows Recent Posts on your Tumblr blog. | |
Its dependency is jQuery. | |
Usage: | |
1) Add html: | |
<div id="recent-posts"></div> | |
2) Download this script and upload it on your server. |
class ErrorsEngine < Rails::Engine | |
routes.draw do | |
Site.all.each do |site| | |
match '(errors)/:status', via: [:get, :post, :put, :patch, :delete], to: 'errors#show', constraints: { host: site.hostname, status: /\d{3}/ } | |
end | |
end | |
end | |
unless Rails.application.config.consider_all_requests_local | |
Rails.application.config.exceptions_app = ErrorsEngine.routes |
module ActiveSupport | |
module Concern | |
def append_features(base) | |
if base.instance_variable_defined?("@_dependencies") | |
base.instance_variable_get("@_dependencies") << self | |
return false | |
else | |
return false if base < self | |
@_dependencies.each { |dep| base.send(:include, dep) } | |
super |