-
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
// Based on http://snipt.net/boriscy/datetime-jquery-formtastic/ | |
$.tools.dateinput.localize("ja", { | |
months: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月', | |
shortMonths: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月', | |
days: '日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日', | |
shortDays: '日,月,火,水,木,金,土' | |
}); | |
$.tools.dateinput.conf.format = 'yyyy-mm-dd'; |
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
var Autocomplete = Backbone.View.extend({ | |
initialize: function(options) { | |
options = _.extend({}, options); | |
_.bindAll(this, 'refresh'); | |
// Input element | |
this.input = options.input; | |
// Choices collection | |
this.choices = options.choices; | |
// Selected collection | |
this.selected = options.selected; |
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
<?xml version="1.0" encoding="Windows-1252" ?> | |
<NotepadPlus> | |
<LexerStyles> | |
<LexerType name="actionscript" desc="ActionScript" ext=""> | |
<!-- | |
<WordsStyle name="DIRECTIVE" styleID="19" fgColor="A001D6" bgColor="363636" fontName="" fontStyle="1" fontSize="" keywordClass="instre2" /> | |
--> | |
<WordsStyle name="DEFAULT" styleID="11" fgColor="FFFFFF" bgColor="363636" fontName="" fontStyle="0" fontSize="" /> | |
<WordsStyle name="FUNCTION" styleID="20" fgColor="95004A" bgColor="363636" fontName="" fontStyle="0" fontSize="" keywordClass="type2" /> | |
<WordsStyle name="PREPROCESSOR" styleID="9" fgColor="804000" bgColor="363636" fontName="" fontStyle="0" fontSize="" /> |
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
@import "twitter/bootstrap"; | |
// ------------------------------- | |
// Links | |
@linkColor: #8b59c2; | |
@linkColorHover: darken(@linkColor, 10); | |
// Grays | |
@black: #000; |
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
(function($){ | |
$('.pagination a[data-remote=true]').live('ajax:success', function(e){ window.history.pushState('', '', $(e.target).attr('href')) }) | |
$(window).bind('popstate', function(){ $.ajax({url:window.location, dataType:'script'}) ; return true }); | |
})(jQuery); |
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
$('#products').append('<%= j render(@products) %>'); | |
<% if @products.next_page %> | |
$('.pagination').replaceWith('<%= j will_paginate(@products) %>'); | |
<% else %> | |
$('.pagination').remove(); | |
<% end %> |
-
Speed up development by only reloading classes if dependencies files changed. This can be turned off by setting
config.reload_classes_only_on_change
to false. José Valim -
New applications get a flag
config.active_record.auto_explain_threshold_in_seconds
in the environments configuration files. With a value of 0.5 in development.rb, and commented out in production.rb. No mention in test.rb. fxn -
Add DebugExceptions middleware which contains features extracted from ShowExceptions middleware José Valim
-
Display mounted engine's routes in
rake routes
Piotr Sarnacki
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
<% [:notice, :error, :alert].each do |level| %> | |
<% unless flash[level].blank? %> | |
<div class="alert-message <%= flash_class(level) %>"> | |
<a class="close" href="#">×</a> | |
<%= content_tag :p, flash[level] %> | |
</div> | |
<% end %> | |
<% 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 BootstrapFormBuilder < ActionView::Helpers::FormBuilder | |
delegate :capture, :content_tag, :tag, to: :@template | |
%w[text_field text_area password_field collection_select].each do |method_name| | |
define_method(method_name) do |name, *args| | |
errors = object.errors[name].any?? " error" : "" | |
error_msg = object.errors[name].any?? content_tag(:span, object.errors[name].join(","), class: "help-inline") : "" | |
content_tag :div, class: "clearfix#{errors}" do |
OlderNewer