Add license and stuff
[railsex.git] / README
blob1861c22bf6eca1a3a2f8e8fa2278022eac9dc889
1 ~[ Description ]~
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 !
6 ~[ How to use ]~
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]
14 end
16 The plugin requires Rails 2.0.x or higher version.
18 ~[ Current Extensions ]~
19  - respond_to
20  - lazy_attributes
21  - console
23 ~[ Current Features ]~
25 * Argument-less support for respond_to :
27 In your controller you can have :
29 respond_to do
30   html
31   xml  { render :xml => @article }
32 end
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
40 end
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
49 ~[ Primary Authors ]~
51 Pratik Naik - http://m.onkey.org
52 Unknown people from the internet for "console" extension