Fix the typos in 24 hours
[railsex.git] / README
blob0c75879808f309539a01e66ee6e7e3bd244b47ca
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 = Install
8 * Using gem
10       $ sudo gem install railsex
11       $ gem unpack railsex vendor/plugins
12   
13 * Using git
14   
15       $ git clone git://repo.or.cz/railsex.git vendor/plugins
17 = Usage
19 Railsex loads extensions only on demand because of the variety of options it provides.
21 You will need to load the extension in your environment.rb configuration block with following syntax :
23   config.after_initialize do
24     config.extensions = [:respond_to, :lazy_attributes, :console]
25   end
27 The plugin requires Rails 2.0.x or higher version.
29 = Current Extensions
31 * respond_to
32 * lazy_attributes
33 * console
35 = Features
37 == Argument-less support for respond_to :
39 In your controller you can have :
41   respond_to do
42     html
43     xml  { render :xml => @article }
44   end
46 == Lazy attributes to provide partial updates
48 You can declare lazy attributes in your model definition :
50   class Person < ActiveRecord::Base
51     lazy_attributes :history, :bio
52   end
54 In this case, when you do @person.save, ActiveRecord will include bio and history columns in UPDATE query only if you accessed 
55 @person.history= or @person.bio= methods.
57 == Very common console tricks
59 * [] finders for model so you can do Article[1], Article[:all]
60 * "log_to" function to print out db queries to rails irb console
62 = Primary Authors
64 Pratik Naik - http://m.onkey.org
66 Unknown people from the internet for "console" extension