This file contains 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 FlashMessagesHelper | |
def render_flash_messages | |
flash.delete(:timedout) # FIX: https://github.com/plataformatec/devise/issues/1777 | |
safe_join flash.map { |flash_type, message| alert_box(flash_type, message) } | |
end | |
private | |
def close_button(dismiss) |
This file contains 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
span.translation_missing { | |
background: red; | |
} |
This file contains 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
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
This file contains 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
# Overcommit configurations followed in BaseApp | |
# | |
#------------------------------------------------------------------------------- | |
# Loads Bundler context from a Gemfile. If false, does nothing (default). | |
# | |
# Specifying a Gemfile for Bundler to load allows you to control which gems are | |
# available in the load path (i.e. loadable via `require`) within your hook | |
# runs. Note that having a Gemfile requires you to include `overcommit` itself | |
# in your Gemfile (otherwise Overcommit can't load itself!). |
This file contains 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
= javascript_include_tag 'jquery/jquery-birthday-picker' | |
:javascript | |
$(document).ready(function() { | |
$('.birth_date_selection').birthdayPicker({monthFormat: 'long', minAge: 18, defaultDate: '15-05-2015'}); | |
}); | |
= form_for @user do |user| | |
.birth_date_selection | |
= user.date_select(:birth_date, order: [:month, :day, :year]) |
This file contains 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
# /lib/unicode_regexp.rb | |
class UnicodeRegexp | |
# Returns string of Special Characters to be used in Regex | |
SPECIAL_CHARACTERS = [ | |
'\\~', '\\!', '\\@', '\\#', '\\$', '\\%', '\\^', '\\&', '\\*', '\\(', '\\)', '\\_', '\\+', '\\-', | |
'\\=', '\\|', '\\{', '\\}', '\\[', '\\]', '\\:', '\\;', '\\"', '\\<', '\\>', '\\.', '\\?', '\\/', | |
"\\\\\s" # Backslash & space character are purposely kept together in a string | |
].join |
This file contains 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
Ruby Weekly |
This file contains 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
# TODOs | |
1. Support for associated models | |
2. Support for serielized models | |
3. Enable/disable search/sort for particular column |
This file contains 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
require 'rails_helper' | |
FactoryGirl.factories.each do |factory| | |
describe "The '#{factory.name}' factory" do | |
it 'is valid' do | |
build(factory.name).should be_valid | |
end | |
factory.definition.defined_traits.each do |trait| | |
describe "The '#{trait.name}' trait" do | |
it 'is valid' do |
This file contains 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
require 'ap' | |
module HashExt | |
def explode_keys(key_delimiter: '.') | |
recursive_hash = self.class.new { |hash, key| hash[key] = self.class.new(&hash.default_proc) } | |
result = self.to_h.reduce(recursive_hash) do |recursive_acc, (input_key_path, input_value)| | |
keys = input_key_path.to_s.split(key_delimiter) | |
tree = keys.map {|key| [:[], key] } |
OlderNewer