Restricting Access in ERB code.
Posted
by LGFaler
on Stack Overflow
See other posts from Stack Overflow
or by LGFaler
Published on 2010-05-09T00:41:23Z
Indexed on
2010/05/09
0:48 UTC
Read the original article
Hit count: 264
I am trying to build a CMS using ERB. Is there a way you can give ERB code read-only access to your models? For instance, I want to be able to load any information on my models (Model.all, Model.find_by_slug, Model.find_by_name, Model.other_model.name, etc...), but I don't want to be able to change this data. Can you disable ERB from executing commands that would make database changes (Model.save, Model.update, Model.delete, Model.destroy, etc.)???
© Stack Overflow or respective owner