public
Description: rails plugin that enables inheritance of views along a controller class heirachy
Homepage: http://plugins.ardes.com/doc/inherit_views
Clone URL: git://github.com/ianwhite/inherit_views.git
Search Repo:
Click here to lend your support to: inherit_views and make a donation at www.pledgie.com !
name age message
folder .gitignore Thu Jun 05 09:28:52 -0700 2008 Ignoring garlic dir [ianwhite]
folder CHANGELOG Thu Apr 24 15:56:48 -0700 2008 Using garlic for CI [ian]
folder MIT-LICENSE Mon Apr 28 06:14:26 -0700 2008 garlic.rb now ignored, so local config is easier [ianwhite]
folder README.rdoc Sun Apr 27 13:25:40 -0700 2008 Better Readme [ianwhite]
folder Rakefile Thu May 22 04:28:43 -0700 2008 Ignoring rcov in coverage [ianwhite]
folder SPECDOC Thu Apr 24 00:47:50 -0700 2008 inherit_views: fixed problem whereby normal con... [ian]
folder garlic_example.rb Thu May 22 04:46:22 -0700 2008 Updated garlic targets, now tested against: 2.0... [ianwhite]
folder init.rb Thu Feb 08 04:57:36 -0800 2007 Initial import of new inherit_views [ian]
folder lib/ Wed May 21 16:10:49 -0700 2008 MInor docfix [ianwhite]
folder spec/ Thu Apr 24 00:47:50 -0700 2008 inherit_views: fixed problem whereby normal con... [ian]
README.rdoc

http://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

  • {SPECDOC}[link:files/SPECDOC.html] lists the specifications
  • {RSpec Report}[link:rspec_report.html] is a report of spec pass/fails
  • {RCov Report}[link:coverage/index.html] is the rcov report

Testing

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