diff options
author | Jeff Dean <jeff@zilkey.com> | 2008-11-14 02:29:12 -0500 |
---|---|---|
committer | Jeff Dean <jeff@zilkey.com> | 2008-11-14 02:29:12 -0500 |
commit | 7eb249291d1c8a8af14c52de4767a36ba8f924e3 (patch) | |
tree | 57b0d3c3c9a59088b46fa009117896efbfe2a463 /railties/doc/guides/source/creating_plugins/odds_and_ends.txt | |
parent | 8a9bd56ca0d43c703f330e378474ddbdca2acd8e (diff) | |
download | rails-7eb249291d1c8a8af14c52de4767a36ba8f924e3.tar.gz rails-7eb249291d1c8a8af14c52de4767a36ba8f924e3.tar.bz2 rails-7eb249291d1c8a8af14c52de4767a36ba8f924e3.zip |
Plugin guide: added model and controller sections
Diffstat (limited to 'railties/doc/guides/source/creating_plugins/odds_and_ends.txt')
-rw-r--r-- | railties/doc/guides/source/creating_plugins/odds_and_ends.txt | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/railties/doc/guides/source/creating_plugins/odds_and_ends.txt b/railties/doc/guides/source/creating_plugins/odds_and_ends.txt index a52e1c8fdb..e328c04a79 100644 --- a/railties/doc/guides/source/creating_plugins/odds_and_ends.txt +++ b/railties/doc/guides/source/creating_plugins/odds_and_ends.txt @@ -19,28 +19,6 @@ Once your comments are good to go, navigate to your plugin directory and run: rake rdoc - -=== Store models, views, helpers, and controllers in your plugins === - -You can easily store models, views, helpers and controllers in plugins. Just create a folder for each in the lib folder, add them to the load path and remove them from the load once path: - -[source, ruby] ---------------------------------------------------------- -# File: vendor/plugins/yaffle/init.rb - -%w{ models controllers helpers }.each do |dir| - path = File.join(directory, 'lib', dir) - $LOAD_PATH << path - Dependencies.load_paths << path - Dependencies.load_once_paths.delete(path) -end ---------------------------------------------------------- - -Adding directories to the load path makes them appear just like files in the the main app directory - except that they are only loaded once, so you have to restart the web server to see the changes in the browser. - -Adding directories to the load once paths allow those changes to picked up as soon as you save the file - without having to restart the web server. - - === Write custom Rake tasks in your plugin === When you created the plugin with the built-in rails generator, it generated a rake file for you in 'vendor/plugins/yaffle/tasks/yaffle.rake'. Any rake task you add here will be available to the app. |