大久保英樹(@oakbow)
流しのRuby/Railsプログラマ ※ 元Job-Hubの開発責任者
| # You need to add your domain into Capybara's whitelist. | |
| RSpec.configure do |config| | |
| Capybara::Webkit.configure do |c| | |
| c.block_unknown_urls | |
| c.allow_url("admin.lvh.me") | |
| end | |
| Capybara.default_selector = :css | |
| : |
| gem 'redis' | |
| gem 'redis-rails' |
| ArgumentError - wrong number of arguments (2 for 1): |
| module ActiveAdmin | |
| module Filters | |
| # lib/active_admin/filters/resource_extension.rb | |
| # サイドバーの検索条件から、default_association_filters を対象外にする。 | |
| # has_manyやhas_oneがプルダウン条件になって恐ろしく重くなる現象の回避策。 | |
| module ResourceExtension | |
| # Returns a default set of filters for the associations | |
| def default_association_filters |
| # change images file path for Rails applications. | |
| .tipsy-arrow { position: absolute; background: url('<%= asset_path 'tipsy.gif' %>') no-repeat top left; width: 9px; height: 5px; } |
| gem 'rack-cors', require: 'rack/cors' |
| # IEのダウンロードファイル名の文字化け対応 | |
| def filename_for_download(filename) | |
| if request.env['HTTP_USER_AGENT'] =~ %r{MSIE} && request.env['HTTP_ACCEPT_LANGUAGE'] =~ /^ja/ | |
| filename = Utf8ToWin31jCodeConverter.convert_to_windows31j(filename) | |
| end | |
| filename | |
| end |
| unless "indexOf" of Array:: | |
| Array::indexOf = (find, i) -> | |
| i = 0 if i is `undefined` | |
| i += @length if i < 0 | |
| i = 0 if i < 0 | |
| n = @length | |
| while i < n | |
| return i if i of this and this[i] is find | |
| i++ |
| original_file_extension = File.extname(@original_filename) | |
| #@original_filename = File.basename(@original_filename) | |
| @original_filename.force_encoding("ascii-8bit") | |
| pp "ascii" | |
| pp @original_filename | |
| @original_filename = @original_filename[0, (configatron.uploadfilename.bytesize - original_file_extension.bytesize)] |