Dynamic view - is it possible at all?

I have the following question. It sounds weird, but still.

We all have app/views/say.rhtml or any other template for the view. It can include of course instructions in <% %> So the question is next -- is it possible to use .rhtml as a view which we just uploaded?

I.e. user uploads his own .rhtml, controller saves it in the database, and shows the view using it.

Is it possible at all?

Thanks!

inrila wrote:

I.e. user uploads his own .rhtml, controller saves it in the database, and shows the view using it.

Is it possible at all?

If you don't mind the security nightmare, just use

   render :inline => MyModel.find(:whatever).your_rhtml

Because that's so high risk, even for internal development we use Lilu. Our graphic artists upload raw HTML, and Lilu installs the template stuff based only on id and class selectors into that HTML.

Another way of doing this is with Liquid. It powers the Shopify commerce system.

http://www.liquidmarkup.org/