-
The new rake task assets:clean removes precompiled assets. [fxn]
-
Application and plugin generation run bundle install unless
--skip-gemfileor--skip-bundle. [fxn] -
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
-
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
This file contains hidden or 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
| <!DOCTYPE html> | |
| <head> | |
| <title>Stay Standalone</title> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
| <script src="stay_standalone.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <ul> | |
| <li><a href="http://google.com/">Remote Link (Google)</a></li> |
This file contains hidden or 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
| # autoload concerns | |
| module YourApp | |
| class Application < Rails::Application | |
| config.autoload_paths += %W( | |
| #{config.root}/app/controllers/concerns | |
| #{config.root}/app/models/concerns | |
| ) | |
| end | |
| end |
This file contains hidden or 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 Project < ActiveRecord::Base | |
| class << self | |
| def always_attributes | |
| %w{attributes anybody can edit} | |
| end | |
| def draft_attributes | |
| %w{available only while project is being written} |
This file contains hidden or 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 'rails', :git => 'git://github.com/rails/rails.git' | |
| gem 'arel', :git => 'git://github.com/rails/arel.git' | |
| gem 'rack', :git => 'git://github.com/rack/rack.git' | |
| gem 'sprockets', :git => 'git://github.com/sstephenson/sprockets.git' | |
| gem 'sqlite3' | |
| # Asset template engines |
This file contains hidden or 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
| connection = Faraday::Connection.new('http://example.com') do |builder| | |
| builder.request :url_encoded # for POST/PUT params | |
| builder.adapter :net_http | |
| end | |
| # same as above, short form: | |
| connection = Faraday.new 'http://example.com' | |
| # GET | |
| connection.get '/posts' |
This file contains hidden or 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
| UPDATE: Please see some of the forks for an updated version of this guide. I | |
| myself have moved onto the Rails 3.1 betas to get the asset pipeline. But if | |
| you want to stay on stable there are other folks who are keeping this guide | |
| relevant despite the changes constantly occurring on Sprockets 2. The comments | |
| on this gist will lead you to the right forks. :) | |
| Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
| powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
| This stuff will be native in Rails 3.1 and the layout of the files on the |
This file contains hidden or 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
| # .railsrc for Rails 3, encoding: utf-8 | |
| # see http://rbjl.net/49-railsrc-rails-console-snippets | |
| if !Rails.application then warn "Rails isn't loaded, yet... skipping .railsrc" else | |
| # # # | |
| def ripl?; defined?(Ripl) && Ripl.instance_variable_get(:@shell); end | |
| # # # | |
| # loggers |
This file contains hidden or 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 RequireLoggedUser | |
| protected | |
| def require_logged_user! | |
| before_filter do | |
| return true if current_user.present? | |
| # if the method hasn't returned, there is no user logged in! | |
| # flash a warning and redirect the user to the log in page | |
| flash[:warning] = "You must log in before proceeding!" | |
| redirect_to new_user_session_path and return | |
| end |
This file contains hidden or 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 Mongo | |
| module Instrumentation | |
| def self.instrument(clazz, *methods) | |
| clazz.module_eval do | |
| methods.each do |m| | |
| class_eval %{def #{m}_with_instrumentation(*args, &block) | |
| ActiveSupport::Notifications.instrumenter.instrument "mongo.mongo", :name => "#{m}" do | |
| #{m}_without_instrumentation(*args, &block) | |
| end | |
| end |