Designing Rails Application with Run time users plugins

Hello,

I would like to help me on the following matter

I would like to write a rails application and allow users to upload plugins and enable or disable them.

I would like to suggest me some designing principles that will allow later the application extension of the application functionality. Some kind of cms application plugins.

Thank you in advance, Kind Regards