radzio
radzio

Reputation: 2892

Ruby on Rails 3 - creating plugins or engines with views and controllers?

I've just started my RoR programming, and I want to create plugin / engine with its view and controllers for my simple rails app. I've found tutorial about creatng plugins on the official rails wiki but unfortunately it is for rails 2 :(

So, how can we write plugin with views and controllers for RoR 3 app.

Upvotes: 2

Views: 947

Answers (2)

Andrea Pavoni
Andrea Pavoni

Reputation: 5311

IMHO, the best way is to use Josè Valim's Enginex gem:

https://github.com/josevalim/enginex

it lets you to easily create a gem skeleton for a rails engine. it also creates a dummy app for tests (supports both rspec and Test::Unit).

Also, Enginex will be the default plugin generator for the upcoming rails 3.1 (actually is rc4).

Upvotes: 1

apneadiving
apneadiving

Reputation: 115541

Rails 3 makes it really easy to achieve this. Actually, once you declare your gem as an Engine, it will look automatically in all the basic folders: /app, /public, ...

I'd suggest you have a look at this github project which is an Engine framework.

You'll be able to build your own using this example.

Upvotes: 2

Related Questions