-
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
source :rubygems | |
gem 'shotgun', :group=>:development | |
gem 'rack-cache' | |
gem 'sinatra', :require => 'sinatra/base' | |
gem 'sinatra-support' | |
gem 'haml' |
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
# Beginning Rubyists: simply run >> ruby hex-convertions.rb to see examples | |
# or use irb to build the code on the fly | |
# you can convert HEX to DEC using the method .to_i(base), | |
# which converts a string to a decimal number from the specified base number | |
puts "00".to_i(16) | |
puts "FF".to_i(16) |
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
Mail = Ember.Application.create(); | |
// Let's pretend that Javascript can handle mutliline strings nicely: | |
Mail.ApplicationView = Ember.View.extend({ | |
template: Ember.Handlebars.compile(' | |
<!-- this gets replaced with content based on state when | |
connectOutlet is called on ApplicationController --> | |
{{outlet}} |
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
# | |
# .zshenv | |
# .zshenv is the 1st file zsh reads; it's read for every shell, even if | |
# started with -f (setopt NO_RCS) | |
# .zprofile | |
# read after zshenv, if the shell is a login shell | |
# .zshrc | |
# read after zprofile, if the shell is an interactive shell | |
# .zlogin | |
# read after zshrc, if the shell is a login shell |
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
# The premise behind this was borrowed from https://gist.github.com/1239732 | |
namespace :assets do | |
# Prepend the assets:prepare task to assets:precompile through | |
# assets:environment | |
task :environment => :prepare | |
task :prepare do | |
# Flag for custom initializers to know we're precompiling assets | |
ENV["RAILS_ASSETS_PRECOMPILE"] = "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
require 'aws/s3' | |
require 'heroku' | |
require 'heroku/command' | |
require 'heroku/command/auth' | |
require 'heroku/command/pgbackups' | |
task :cron do | |
class Heroku::Auth | |
def self.client | |
Heroku::Client.new ENV['heroku_login'], ENV['heroku_passwd'] |
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
// | |
// Backbone.Rails.js | |
// | |
// Makes Backbone.js play nicely with the default Rails setup, i.e., | |
// no need to set | |
// ActiveRecord::Base.include_root_in_json = false | |
// and build all of your models directly from `params` rather than | |
// `params[:model]`. | |
// | |
// Load this file after backbone.js and before your application JS. |
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
# thin | |
# assuming there's an appropriate .rvmrc in /path_to_rails_app/current | |
cd rails_app/current | |
gem install thin | |
rvm wrapper your_ruby@your_gemset your_app_name thin | |
# now we can use your_app_name_thin in Monit scripts | |
# /etc/monit.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
# lib/tasks/resque.rake | |
require 'resque/tasks' | |
task "resque:setup" => :environment do | |
ENV["VVERBOSE"] = "1" if Rails.env.development? | |
end | |
desc "Starts the heroku worker" | |
task "jobs:work" => :environment do |