Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

inherited views for Rails 3.1

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Rakefile
Octocat-spinner-32 inherited_rails_views.gemspec

DRY views

The old inherited views project by Fred was a great idea. With Rails 3.1, inherited views got even simpler. This Project provides you with basic views for your CRUD actions. No generators, no nothing ;)


Add the inherited_rails_views gem to your Applications Gemfile:

gem 'inherited_rails_views'


class TestsController < InheritedResources::Base
    include InheritedRailsViews

    # now all attributes of collection are shown in the views.
    # You can, however, specify which ones should be used.
    before_filter do
        inherited_attributes :attr1, :attr2, :attr3 => {:value => "Custom Titled Attribute", :type => :checkbox}

You can also override any of the files in https://github .com/rweng/inherited_rails_views/tree/master/lib/inherited_rails_views/views/application.


Inherited Rails Views provides provides and uses the method irv_t for translations. irv_t takes a lazy lookup string and tries to look up the translation over different paths. Example:

# called from /countries/index
irv_t "", :default => "Show This", :bla => 1
# tries looking up in the following order:

If none of translation keys are set, "Show This" is displayed. The variable bla is passed in the localization value.

Something went wrong with that request. Please try again.