Dom
Dom

Reputation: 1486

Rails Plugins

Is it possible to include view code in a plugin, such that an app using the plugin can simply call reference the view code like it might reference one of its own partials.

Am I off track here or are there good examples of plugins which do this..

Upvotes: 1

Views: 213

Answers (3)

Adam Lassek
Adam Lassek

Reputation: 35515

You can do that with Rails Engines.

This functionality has long-since been moved into Rails. Here's a guide for getting started.

Upvotes: 1

Michael K Madison
Michael K Madison

Reputation: 2209

Kaminari does this. It has default views for pagination which you can override by generating views and editing them and the gem searches for them. Is that what you mean?

Upvotes: 0

Ryan Bigg
Ryan Bigg

Reputation: 107728

You can do this with the engine stuff that's already built into Rails 2.3, I've done it with calenduh. This is supposedly vastly improved in the up and coming Rails 3.

Upvotes: 1

Related Questions