From 7eb249291d1c8a8af14c52de4767a36ba8f924e3 Mon Sep 17 00:00:00 2001 From: Jeff Dean Date: Fri, 14 Nov 2008 02:29:12 -0500 Subject: Plugin guide: added model and controller sections --- .../source/creating_plugins/odds_and_ends.txt | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'railties/doc/guides/source/creating_plugins/odds_and_ends.txt') 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. -- cgit v1.2.3