Giter VIP home page Giter VIP logo

Comments (5)

cowboyd avatar cowboyd commented on June 13, 2024

It seems to me that the variables in the controller should not be visible at all inside the cells. Isn't that better encapsulation? I.e. if it isn't passed as an option to the cell, then it isn't visible. I've actually been burned by this in the past where I had cells silently depending on variables set in the controller.

from cells.

apotonick avatar apotonick commented on June 13, 2024

this is NOT the intended behaviour, but a serious bug! the cell view should never know anything about controller variables. guess the problem is inside ActionView::Base where controller variables are prefered in place of the passed local vars. damn- gotta fix that.
thanks for spotting

from cells.

apotonick avatar apotonick commented on June 13, 2024

fixed in bf49226
please report if that works for you!

from cells.

kinokuni avatar kinokuni commented on June 13, 2024

I'm sorry for the late reply, but I tested the source
and I confirmed that it works as expected for me.
Thank you.

from cells.

apotonick avatar apotonick commented on June 13, 2024

thank you, kinokuni.

one thing we have to take into account is that controller ivars with no same-named cell ivar will still be accessible in the cell view, since an unspecified set of controller ivars have to be around in the view, for helpers, so we have to copy them. sucks, but i don't see any way around that if we want to stay forward-compatible.

from cells.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.