views:

66

answers:

3

I'm just wondering how to implement database views in Ruby on Rails. Can you guys put some working example? And thank you for every advises and examples.

A: 

There is this plugin, untested.

I have never used database views, and I believe is not something that Rails developer have to use often either, probably because violates the MVC pattern.

Chubas
+3  A: 

You mean client-side views on the database or views within the database?

Most relational databases support views which encapsulate a projection or other set-based operation into a virtual table:

CREATE VIEW viewname AS
SELECT *
       ,some_derived_column
FROM basetable
WHERE some_filter_criteria

Rails typically uses a pattern called Active Record to map database tables/views into Ruby for access at that layer. How you deal with it at that point is kind of wide open.

Cade Roux
A: 

Here try this list of all plugin it may helps you.