Git Product home page Git Product logo

Comments (5)

konung avatar konung commented on August 16, 2024

from cells.

gkulasik avatar gkulasik commented on August 16, 2024

Thanks for the suggestion! I'll move my question over to Gitter.

Calling the cell won't work - Cells throws that exception because it cannot find the partial so if I call the cell I hit the exception before it is rendered. It's possible I am not understanding your solution. I am still pretty new to Cells.

from cells.

apotonick avatar apotonick commented on August 16, 2024

Hi Greg,

rendering partials in a cell is a hack, and we only support it so "application partials" can be rendered by the developers of the cell calling render partial: .... This is to help people move from monolithic view architectures to cells.

Having that said, I'm afraid using your Alchemy helpers in the cell is the wrong approach. We could make the rendering of the partial work, but then, other dependencies might be missing, and so on. The problem is that normal Rails helpers are designed without any interfaces and do access global state, use capture etc. and unfortunately, most gems build on top of that crap lack of API, which I personally do not understand, but, yeah.

To get that partial rendering working, you can hack the cell's render method the way we do it in the partial.rb file - let me know if that works or not!

from cells.

apotonick avatar apotonick commented on August 16, 2024

Here's the file you're interested in: https://github.com/trailblazer/cells/blob/master/lib/cell/partial.rb#L4

Once you found a way to make it work, please post it here so we can discuss a canonical solution. 🍻

from cells.

gkulasik avatar gkulasik commented on August 16, 2024

Thanks for the tips, @apotonick!

I've looked into this more over the last few days. I think you are right about the issues with partials and helpers. Alchemy uses helpers for everything, including capture. This results in missing dependency after dependency. I've decided to just use the 'standard' Rails approach to get through this project :/.

Given the amount of work needed to make this work via monkey patching, I think a better solution would be to enhance Alchemy to use Cells rather than helpers. A project for another day :).

Thanks for the help! Will close now since this is not an issue with Cells but more an external gem limitation.

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.