Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

58 lines (39 sloc) 1.75 kb


A view model/representer solution for Padrino and Rails.


  • Polymorph view model objects that correspond to model objects.
  • View model specific templates.
  • Hierarchical Template Rendering: Allows generalized templates for a class tree of view models.
  • Helper methods directly on the view models.
  • No view related code in the models.
  • A clean API for use in Padrino/Rails.
  • 100% rcov coverage, nice metrics, gallons of blood and sweat by excellent contributors.


Padrino (via Gem)

Note: The Padrino API might change as I get acquainted with the Padrino way of doing things. Basic calls like render_as without all its options will stay the same, and so will view_model_for.

gem install view_models

and then adding the line

gem 'view_models', '>=2.0.0' # for example

in your Gemfile, followed by your app file(s):

require 'view_models'
class MyApplication < Padrino::Application
  register Padrino::ViewModels

Note: Adheres to the Padrino style by explicitly registering.

Rails (via Gem)

gem install view_models

and then adding the line

config.gem 'view_models'

in your environment.rb.

Links Galore!

Usage, Examples, In-depth Infos [Wiki]
Reference [RDoc]
Gem []
Mailing List
Bug Tracker
Source [Github]

Jump to Line
Something went wrong with that request. Please try again.