title: Building an extension framework for a Rails app
body: <p>I'm starting research on what I'd need in order to build a user-level plugin system (like Wordpress plugins) for a Rails app, so I'd appreciate some general pointers/advice. By user-level plugin I mean a package a user can extract into a folder and have it show up on an admin interface, allowing them to add some extra configuration and then activate it.</p>
  
  <p>What is the best way to go about doing this? Is there any other opensource project that does this already? What does Rails itself already offer for programmer-level plugins that could be leveraged? Any Rails plugins that could help me with this?</p>
  
  <p>A plugin would have to be able to:</p>
  
  <ul>
  <li><strong>run its own migrations</strong> (with  <a href="http://apidock.com/rails/ActiveRecord/Migrator/run/class" rel="noreferrer">this</a>? it's undocumented)</li>
  <li><strong>have access to my models</strong> (plugins already do)</li>
  <li><strong>have entry points for adding content to views</strong> (can be done with <a href="http://apidock.com/rails/ActionView/Helpers/CaptureHelper/content_for" rel="noreferrer">content_for and yield</a>)</li>
  <li><strong>replace entire views or partials</strong> (how?)</li>
  <li><strong>provide its own admin and user-facing views</strong> (how?)</li>
  <li><strong>create its own routes</strong> (or maybe just announce its presence and let <em>me</em> create the routes for it, to avoid plugins stepping on each other's toes)</li>
  </ul>
  
  <p>Anything else I'm missing?</p>
  
  <p>Also, is there a way to limit which tables/actions the plugin has access to concerning migrations and models, and also limit their access to routes (maybe letting them include, but not remove routes)?</p>
  
  <p><sub>P.S.: I'll try to keep this updated, compiling stuff I figure out and relevant answers so as to have a sort of guide for others.</sub></p>