This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to make <i> easily. | |
# name: icon class name. | |
# data: webfont number.some webfonts like icomoon can use with this. | |
# color: for Bootstrap2.0. you can set this 'white' for white icon. | |
# class: you can set css class to <i> tag. | |
# style: you can set inline css to <i> tag. | |
def icon_tag(options) | |
raise unless options.present? | |
case options | |
when String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target Distribution -> Behaviors -> Edit -> Forward Query Strings -> turn 'Yes' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rack-cors', require: 'rack/cors' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArgumentError - wrong number of arguments (2 for 1): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'redis' | |
gem 'redis-rails' |
OlderNewer