Hi all,

I'm currently doing a little CMS system in Rails and I would like the
user/administrator of a site to be able to render partials on pages. I
have a Page model with a content attribute. Inside that attribute I
would like the admin to be able to put something like this:

{contact_form submit:"Submit now!" reset:"Reset form"}

This is just an example, but this should then render a partial like
this:

render :partial => "widgets/contact_form", :locals => {:submit =>
"Submit now!", :reset => "Reset form"}

I have been trying to make up a regular expression to approach this, but
I'm not very good at it. It looks like this:

/\{(\w+) (\w+):(.+)*\}/

But it is hard to make it respect multiple arguments, if you know what I
mean. Now, if any of you have an idea of how to finish this regular
expression, or maybe know a different solution of how to let the admin
render partials "dynamically", I would appreciate if you'd let me know.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to