Saifis
Saifis

Reputation: 2237

How to make a gem for a Rails app that has its own routes, views, and models

I am creating an app, and want to create a specialized gem for it, because not all deployments of the app require the features that are going to be tucked in the gem, the feature being gemified will have its own MVC's so its more like a detachable small Rails app.

For the sake of explaining, say its a blog application, the blog applications core feature obviously is to be a blog.

I would like to add a newsletter feature to this app. which would need

  1. subscription signup pages, a newsletter editing page
  2. routes for the above pages
  3. model to save the subscribers, perhaps to save the newsletter itself

Ideally I would like to be able to add a specialized gem 'blog_newsletter' to the blog app, install, and would be able to access to the subscription sign up page, write one and send newsletters.

Is there a gem that I could look at for reference? or some tutorial? I can find tutorials and examples for normal gems, but not ones for this.

Upvotes: 0

Views: 103

Answers (1)

Amar
Amar

Reputation: 6942

Typically it's rails engine,there are various article on rails engine by googling you can find out,but you can look into forem gem to get exact idea

Upvotes: 1

Related Questions