Add the following to your application.rb
class Application < Rails::Application config.sass.load_paths << “#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets” config.sass.load_paths << “#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/blueprint/stylesheets” end
When I try to move the Devise stuff into a module User::Devise and include it in class User, I got this warning ‘warning: toplevel constant Devise referenced by User::Devise’
Please see the code before and after for a solution.
Solution is to make User::Devise before you do the include for class User
from http://ar.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html :host - Defaults to “localhost”. :port - Defaults to 5432. :username - Defaults to nothing. :password - Defaults to nothing. :database - The name of the database. No default, must be provided. :schema_search_path - An optional schema search path for the connection given as a string of comma-separated schema names. This is backward-compatible with the :schema_order option. :encoding - An optional [...]
p = Person.new p.first_name = ‘Tian’ p.last_name = nil p.first_name? # => true p.last_name? # => false
from http://benwoodall.com/2011/06/rails-global-access-to-rake-dsl-methods-is-deprecated/
So apparently the newest version of Rake (0.9+) breaks rails. You will get the error: WARNING: Global access to Rake DSL methods is deprecated. Please Include … Rake::DSL into classes and modules which use the Rake DSL methods. The quick fix is to downgrade to Rake 0.8.7, but you can also add this little [...]
deploy a branch
set :branch, $1 if `git branch` =~ /\* (\S+)\s/m
deploy current commit
set :branch, $1 if `git rev-parse HEAD` =~ /(\S+)/
This trick is for Rails 3 (maybe Rails 2)
Just add a leading ‘^’ in the string as below:
validates_presence_of :role_id, :message => ‘^Please select a role’
from: http://jeffancel.com/blog/show-activerecord-sql-in-rails-3-console/2011/03
If you want to show sql in your console for Active Record, then you may have run across the past Rails Recipes book or similar formulas for Rails < v3.0. I just tweaked a formula I saw in that book to work with Rails 3 and here it is (This is designed to work [...]
ActiveRecord::SessionStore::Session.find
from http://markconnell.co.uk/posts/2010/02/rails-3-routing-examples
Rails 3 introduced a new routing DSL that is a little bit different from the Rails 2 version. This quick guide covers a few examples of the new routes, and how they compare to Rails 2.
Simple routes
Create a basic route that will respond to http://localhost:300/hello_world
# Rails 2: map.connect ‘hello_world’, :controller [...]
-
Articles
- February 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
-
Meta