-
The new rake task assets:clean removes precompiled assets. [fxn]
-
Application and plugin generation run bundle install unless
--skip-gemfile
or--skip-bundle
. [fxn] -
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
-
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
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
# Suppose you were designing a library named "Zippo". | |
# How would you organize the exceptions thrown by the library. | |
# Option 1 | |
# All library errors inheriting from a common base | |
module Zippo | |
class ZippoError < StandardError; end | |
class ZippoArgumentError < ZippoError; end | |
class ZippoTypeError < ZippoError; 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
<!-- A scaffolded edit view converted to mustache --> | |
<h1>Editing post</h1> | |
{{#form}} | |
{{#errors?}} | |
<div id="error_explanation"> | |
<h2>{{error_header}}</h2> | |
</div> | |
<ul> |
The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.
You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.
- Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
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 FormHelper | |
attr_accessor :form | |
def initialize(nsform=nil) | |
@form = nsform | |
end | |
def length | |
form.numberOfRows | |
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
# 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 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
#!/usr/bin/env ruby | |
module TopLevel | |
CONST_D = :d_from_top_level | |
module MiddleLevel | |
class BottomLevel | |
CONST_A = :foo | |
CONST_B = :bar | |
CONST_C = :c_from_bottom_level |
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 Credential | |
include ActiveModel::Validations | |
attr_accessor :screen_name, :oauth_token, :oauth_secret, :token, :description | |
validates_presence_of :screen_name, :oauth_token, :oauth_secret, :message => 'required' | |
validate :user_exists, :unless => :errors? | |
def initialize(attributes = {}) | |
attributes.each {|k, v| set_recognized_attribute(k, v) } |
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
### | |
# This is a JSON building library. It allows you to build data structures | |
# to dump as JSON. Here is a sample of how to use it: | |
# | |
# def person_hash(person) | |
# { | |
# 'name' => person.name, | |
# 'age' => person.age, | |
# 'friends' => person.friends.map { |x| person_hash x } | |
# } |
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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |