public
Description: rails plugin that enables inheritance of views along a controller class heirachy
Homepage: http://ianwhite.github.com/inherit_views
Clone URL: git://github.com/ianwhite/inherit_views.git
commit  129264b8ffc569d913f9cdb824622510dc292249
tree    6cdad7cc7866a21b67263fc2ead7fba047bc671f
parent  bcc0af01f1a14a32ded2f1e7299fae2310e8f70d
name age message
file .gitignore Loading commit data...
file CHANGELOG
file MIT-LICENSE Fri Feb 06 01:09:38 -0800 2009 Simplify Rakefile, README, etc [ianwhite]
file README.rdoc
file Rakefile
file SPECDOC
file garlic_example.rb
file init.rb Thu Feb 08 04:57:36 -0800 2007 Initial import of new inherit_views git-svn-id... [ian]
directory lib/ Wed May 21 16:10:49 -0700 2008 MInor docfix [ianwhite]
directory spec/
README.rdoc

plugins.ardes.com > inherit_views

inherit_views

This plugin allows your controllers to inherit their views from parent controllers. The default behaviour is to inherit along the ancestor path of the controller, but you can also specify custom inherit view paths to search.

NOTE: this plugin is not aimed at having multiple view paths for your controllers, which is addressed with the view_paths addition to ActionController::Base for rails 2.0. Rather, within these view paths, you can inherit views from other controller paths.

Example:

  class ApplicationController < ActionController::Base
    inherit_views
  end

  class FooController < ApplicationController
    # will look for views in 'views/foo', then 'views/application'
  end

  class BarController < FooController
    # will look for views in 'views/bar', then 'views/foo', then 'view/application'
  end

You can also render the parent view in your views with

  <%= render_parent %>

See Ardes::InheritViews for more details

Specs and Coverage

Testing

RSpec is used for testing, so the tests are in spec/ rather than test/ Do rake —tasks for more details.