gem | draper | active_decorator |
参考URL | Railscast #286 | Rails3レシピブック外伝 recipe 10 |
反映タイミング | HogeDecorator 使用時 | view_assigns 時 |
関連対応 | decorates_association | partial render 時 |
参考:
% ruby -v gsub.rb | |
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] | |
<a><b><c> | |
% ruby -v gsub.rb | |
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] | |
<a><b><c> |
gem | draper | active_decorator |
参考URL | Railscast #286 | Rails3レシピブック外伝 recipe 10 |
反映タイミング | HogeDecorator 使用時 | view_assigns 時 |
関連対応 | decorates_association | partial render 時 |
参考:
class << I18n | |
alias orig_translate translate | |
def translate(*args) | |
STDERR.puts args.inspect | |
orig_translate(*args) | |
end | |
alias t translate | |
end |
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- https://gist.github.com/3906168 --> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="user-scalable=no, width=device-width" /> | |
<script type="text/javascript" src = "http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
window.addEventListener("devicemotion",onDeviceMotion,false); |
Installing rmagick (2.13.1) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/kazu/.rbenv/versions/1.9.3-p327/bin/ruby extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for Magick-config... yes checking for ImageMagick version >= 6.4.9... yes checking for HDRI disabled version of ImageMagick... yes
# -*- coding: utf-8 -*- | |
# alias_method_chain problem demo | |
# checked with rails 3.2.11 | |
# | |
# usage: | |
# rails new /tmp/amc-problem-demo --skip-bundle --skip-active-record --skip-test-unit -m amc-problem-demo.rb | |
# cd /tmp/amc-problem-demo | |
# bundle install | |
# bundle exec rails server | |
# open http://localhost:3000/ |
# -*- coding: utf-8 -*- | |
# config/initializers/date_time_selector.rb | |
# based on actionpack-3.2.11/lib/action_view/helpers/date_helper.rb | |
require "action_view/helpers/date_helper" | |
class ActionView::Helpers::DateTimeSelector | |
undef select_day | |
def select_day | |
if @options[:use_hidden] || @options[:discard_day] | |
build_hidden(:day, day || 1) | |
else |
au BufNewFileBufRead *.rb syn keyword rubyInclude prepend | |
au BufNewFileBufRead *.rb syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(prepend\)\>" |
do ($ = jQuery) -> | |
jQuery.fn.autogrow = (options) -> | |
settings = $.extend { | |
extraLineHeight: 15 | |
timeoutBuffer: 100 | |
}, options | |
self = this | |
timerId = self.removeData('timerId') | |
if timerId | |
clearTimeout timerId |