3 Railsex - pronounced "Rails Extensions" OR "Ex Rails" ( easier to say ) - is a plugin for all those cool/good to have/experimental features
4 which cannot possibly be in core due to their nature. As rails itself, this plugin is supposed to be a community effort. So, do chime in !
8 Railsex loads extensions only on demand because of the variety of options it provides.
10 You will need to load the extension in your environment.rb configuration block with following syntax :
12 config.after_initialize do
13 config.extenstions = [:respond_to, :lazy_attributes, :console]
16 The plugin requires Rails 2.0.x or higher version.
18 ~[ Current Extensions ]~
23 ~[ Current Features ]~
25 * Argument-less support for respond_to :
27 In your controller you can have :
31 xml { render :xml => @article }
34 * Lazy attributes to provide partial updates
36 You can declare lazy attributes in your model definition :
38 class Person < ActiveRecord::Base
39 lazy_attributes :history, :bio
42 In this case, when you do @person.save, ActiveRecord will include bio and history columns in UPDATE query only if you accessed
43 @person.history= or @person.bio= methods.
45 * Very common console tricks
46 - [] finders for model so you can do Article[1], Article[:all]
47 - "log_to" function to print out db queries to rails irb console
51 Pratik Naik - http://m.onkey.org
52 Unknown people from the internet for "console" extension