[LRUG] Proffer and introducing constraints to Rails

James Hunt ohthatjames at gmail.com
Mon Apr 2 02:27:47 PDT 2012


Proffer is also more restrictive: we're exposing variables at an action
level rather than a controller level, so you only have to expose the
minimal interface required for any given view.

I imagine it's possible to use both together: proffer to turn off ivars and
decent_exposure to expose what you wanted.

On Mon, Apr 2, 2012 at 10:23 AM, mudge <mudge at mudge.name> wrote:

> We had a brief look at decent_exposure but found that it focussed on
> promoting the pattern of using `helper_method` to expose functionality
> to views from the controller (something the list discussed recently
> when I raised the issue of before_filter abuse in Rails).
>
> Our goal was simpler in a way: stop Rails passing instance variables
> to your views; the `proffer` API came about almost as a side-effect of
> that.
>
> On Mon, Apr 2, 2012 at 10:09 AM, Tom Stuart <tom at experthuman.com> wrote:
> > On 2 Apr 2012, at 09:59, James Hunt wrote:
> >> There is more information on GitHub but the summary is that it stops
> Action
> >> Controller from exposing all defined instance variables to your views
> by default
> >> and instead provides a way to explicitly declare your dependencies
> instead.
> >
> > This reminds me of https://github.com/voxdolo/decent_exposure. Had you
> previously tried that and found it inadequate / stupid / insufficiently
> strict?
> >
> > Cheers,
> > -Tom
> > _______________________________________________
> > Chat mailing list
> > Chat at lists.lrug.org
> > http://lists.lrug.org/listinfo.cgi/chat-lrug.org
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20120402/c72372e2/attachment.html>


More information about the Chat mailing list