-
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
# index.html.erb | |
<ul id="projects"> | |
<% @projects.each_with_index do |project, index| %> | |
<% content_tag_for :li, project do %> | |
<%= project.name %> | |
<%= button_to('up', :action => 'sort', :projects => @projects.swap(index, index -1)) if index > 0 %> | |
<%= button_to('down', :action => 'sort', :projects => @projects.swap(index, index +1)) if index < @projects.length - 1 %> | |
<% 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
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
## | |
# With regular RSpec stubbing | |
it 'should allow JPG images' do | |
photo = Photo.new :photo => fixture_file_upload('photos/chameleon.jpg', 'image/jpeg') | |
photo.stub!(:save_attached_files).and_return true | |
photo.save.should be_true | |
end | |
## | |
# With Mocha on "any" instance of a Class |
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 Dragonfly | |
module Endpoint | |
def success_headers(job) | |
{ | |
"Content-Type" => job.app.resolve_mime_type(job.result), | |
"Content-Length" => job.size.to_s, | |
"Content-Disposition" => "filename=#{job.name}" | |
}.merge(cache_headers(job)) | |
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
user app; | |
worker_processes 2; | |
error_log /home/app/logs/nginx.error.log info; | |
events { | |
worker_connections 1024; | |
} | |
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
gem 'resque', '>= 1.10.0' | |
gem 'heroku' # You will need the heroku gem for this too. |
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 |
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
// | |
// 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. |
OlderNewer