Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6063135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:07:53+00:00 2026-05-23T09:07:53+00:00

How can I convert the Forum application I’ve been developing into a Rails Engine,

  • 0

How can I convert the Forum application I’ve been developing into a Rails Engine, so that it may be embedded inside other applications?

What should I add, keep, or remove? Should I offer a way to integrate the models? How do I set up routes and user configuration? How do I package it into a Gem? What should I watch out for?


After reading the articles and the documentation, I managed to narrow down my questions:

  • Should I namespace the models? That is, should I keep them in my Engine’s module and in the app/models/engine folder?
  • What configuration files in config should I keep around?
  • What about the public folder? In Rails 3.1, stylesheets and javascripts were moved to the app/assets folder, which solved this problem, but how do I achieve the same effect in Rails 3.0?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:07:54+00:00Added an answer on May 23, 2026 at 9:07 am

    Too many questions here to answer them all properly. This is one of those things that will pay off for you by just digging in and trying it out. As you get deeper into it, come back and ask new specific questions.

    Here are some of the resources I used when I recently did this.

    • http://www.themodestrubyist.com/2010/03/05/rails-3-plugins—part-2—writing-an-engine/
    • http://www.themodestrubyist.com/2010/03/16/rails-3-plugins—part-3—rake-tasks-generators-initializers-oh-my/
    • http://pragprog.com/titles/jvrails/crafting-rails-applications
    • http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/

    For the most part, you can keep the things in your app directory where they are. You should also be able to keep your routes.rb in the config directory, but there can be some gotchas if some of your routes collide with those of the app.

    You will likely want to create a generator to create a migration that has all of the tables your engine requires. Other generators can be created to override default views and that sort of thing.

    Do create a test application that uses your gem. Many of the issues you will run into are making sure you are loading your engine’s dependencies properly. While you are in development, edit the Gemfile of your test application to point straight to the source of your gem… something like this:

    gem 'my-forum', :path => '~/work/my-forum'
    

    Namespacing

    You should at least name your tables/models so you don’t run into naming collisions. Looking at your current forum app, I’d at least prefix all of your tables with ‘forum_’. It is quite likely that someone using your engine will have a different model named Category for example… so ForumCategory would be a better choice.

    Definitely namespace any classes you create in the lib directory.

    Config Files

    You’ll want to keep your routes.rb in the config directory. You may also need to keep your initializers around as well. Any app specific things will likely need to get moved elsewhere.

    Public Files

    With Rails 3.0.x, you can keep stylesheets and javascripts in the public directory. I think there is a bit of code you need to add to your Engine class though…

    initializer "static assets" do |app|
      app.middleware.use ::ActionDispatch::Static, "#{root}/public"
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need an encoder that can convert mp3 files to he-aac (aka aac+). So
I can have Spring convert my json POST submission into an object with a
I'm trying to convert some code that worked great in VB, but I can't
I want write an win-form application to convert data from foxpro table into sql
How can I convert a varchar field of the form YYYYMMDD to a datetime
How can I convert a date time string of the form Feb 25 2010,
You can convert a negative number to positive like this: int myInt = System.Math.Abs(-5);
we can convert character to an integer equivalent to the ASCII value of the
How i can convert to c# code files to html files?Is there any generation
How i can convert number 20020415 to date 15.04.2002. I am working in Microsoft

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.