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
class MultiSelectWithoutCtrl | |
constructor: (_this, options)-> | |
@id = null | |
@name = options["name"] | |
@select = _this | |
@checkboxes = $("<div class='hidden_multi_select'></div>") | |
@select.after(@checkboxes) | |
@selected() | |
selected: -> | |
@select.on "click" , (event) => |
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
# frozen_string_literal: true | |
module Refinements | |
module AssociationCollectionExtension | |
refine ActiveRecord::Associations::CollectionProxy do | |
def find_or_build_by(arguments) | |
find_by(arguments) || build(arguments) | |
end | |
def detect_or_build_by(arguments) | |
self.detect do|instance| |
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
#! /usr/bin/env ruby | |
exec("LANG=ja_JP.sjis grep -rn `echo #{ARGV[0]} | nkf -s` #{ARGV[1]} | nkf -w") |
OlderNewer