-
The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]
-
jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]
-
Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]
-
The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]
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
$('#candidate_form').relatedSelects({ | |
onChangeLoad: '/candidate/profile/update_locations_select', | |
defaultOptionText: I18n.translate('general.choose_option'), | |
selects: { | |
'candidate_profile[country_id]' : { | |
loadingMessage: I18n.translate('general.loading_provinces') | |
}, | |
'candidate_profile[province_id]': { | |
loadingMessage: I18n.translate('general.loading_locations') | |
}, |
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
.fan_box .full_widget { | |
border: solid 1px #94A3C4; | |
background: white; | |
} | |
.fan_box .connections_grid .grid_item { | |
float: left; | |
overflow: hidden; | |
padding: 0 5px 8px 0; | |
} |
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
Element.addMethods({ | |
focused: function(element) { | |
return element === document.activeElement && ( element.type || element.href ); | |
} | |
}); | |
$(document).on('mouseleave', 'input.special', function(e, el){ | |
if (!el.focused() || el.focused().length == 0) { | |
el.removeClassName("special-focus"); | |
} |
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
# Create design documents with the filters | |
curl -vX PUT 'http://127.0.0.1:5984/couchdb_myapp_development/_design/Product' -d '{ | |
"_id": "_design/Product", | |
"language": "javascript", | |
"filters": { | |
"product": "function(doc, req) { return doc['type'] == 'Product'; }" | |
} | |
}' | |
curl -vX PUT 'http://127.0.0.1:5984/couchdb_myapp_development/_design/Person' -d '{ |
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
<select name="initiative[collaborator_ids][]" multiple="multiple" id="initiative_collaborator_ids" class="multiselect" style="display: none;"> | |
<option value="5" selected="selected">[email protected]</option> | |
<option value="7">[email protected]</option> | |
<option value="8">[email protected]</option> | |
<option value="9">[email protected]</option> | |
<option value="10">[email protected]</option> | |
<option value="11">[email protected]</option> | |
<option value="12">[email protected]</option> | |
<option value="13">[email protected]</option> | |
<option value="14">[email protected]</option> |
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 Sunspot | |
module Rails | |
module SolrInstrumentation | |
extend ActiveSupport::Concern | |
included do | |
alias_method :request_without_as_instrumentation, :request | |
alias_method :request, :request_with_as_instrumentation | |
end |
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
class DynamicInclusionValidator < ActiveModel::EachValidator | |
def check_validity! | |
raise ArgumentError, "A proc which result has the method include? is required as the " << | |
":in option of the configuration hash" unless options[:in].respond_to?(:call) | |
end | |
def validate_each(record, attribute, value) | |
unless options[:in].bind(record).call.include?(value) | |
record.errors.add(attribute, :inclusion, options.except(:in).merge!(:value => value)) | |
end |
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
RSpec.configure do |config| | |
# RSpec automatically cleans stuff out of backtraces; | |
# sometimes this is annoying when trying to debug something e.g. a gem | |
config.backtrace_clean_patterns = [ | |
/\/lib\d*\/ruby\//, | |
/bin\//, | |
/gems/, | |
/spec\/spec_helper\.rb/, | |
/lib\/rspec\/(core|expectations|matchers|mocks)/ | |
] |
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
// Convert a multi-select into a single_select which keeps track of choices in an external list with | |
// hidden fields. The hidden fields have the same field name as the multi select. list_class | |
// defaults to the select id + "_data" Chosen options are moved from the 'Add' option group to | |
// the 'Remove' option group, Each suffixed by the given 'title' or the string "Option". The select | |
// header is extracted from the select's label for - if it exists. Otherwise it just prints 'Options...' | |
// | |
// Example: | |
// | |
// $("select_multi").multiSingleSelect({list_class:'select_multi_data', title:'Option', | |
// remove: "Remove", add: "Add", prompt: "Options..."}); |