Froze rails gems
[depot.git] / vendor / rails / railties / doc / guides / source / creating_plugins / index.txt
1 The Basics of Creating Rails Plugins
2 ====================================
3
4 A Rails plugin is either an extension or a modification of the core framework. Plugins provide:
5
6 * a way for developers to share bleeding-edge ideas without hurting the stable code base
7 * a segmented architecture so that units of code can be fixed or updated on their own release schedule
8 * an outlet for the core developers so that they don’t have to include every cool new feature under the sun
9
10 After reading this guide you should be familiar with:
11
12 * Creating a plugin from scratch
13 * Writing and running tests for the plugin
14 * Storing models, views, controllers, helpers and even other plugins in your plugins
15 * Writing generators
16 * Writing custom Rake tasks in your plugin
17 * Generating RDoc documentation for your plugin
18 * Avoiding common pitfalls with 'init.rb'
19
20 This guide describes how to build a test-driven plugin that will:
21
22 * Extend core ruby classes like Hash and String
23 * Add methods to ActiveRecord::Base in the tradition of the 'acts_as' plugins
24 * Add a view helper that can be used in erb templates
25 * Add a new generator that will generate a migration
26 * Add a custom generator command
27 * A custom route method that can be used in routes.rb
28
29 For the purpose of this guide pretend for a moment that you are an avid bird watcher. Your favorite bird is the Yaffle, and you want to create a plugin that allows other developers to share in the Yaffle goodness. First, you need to get setup for development.
30
31
32 include::test_setup.txt[]
33
34 include::core_ext.txt[]
35
36 include::acts_as_yaffle.txt[]
37
38 include::migration_generator.txt[]
39
40 include::generator_method.txt[]
41
42 include::models.txt[]
43
44 include::controllers.txt[]
45
46 include::helpers.txt[]
47
48 include::custom_route.txt[]
49
50 include::odds_and_ends.txt[]
51
52 include::appendix.txt[]