ViewModels

A view model/representer solution for Padrino and Rails.

Features

Installation

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
  ...
end

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 [RubyGems.org] Mailing List Bug Tracker Metrics Source [Github] Homepage