Giter Club home page Giter Club logo

Comments (2)

ageweke avatar ageweke commented on July 29, 2024

Hmmm. This is a really difficult problem. While I’ve seen Rails people say “don’t do that in a model!”, I’ve wanted to do exactly the same kind of thing, for the same reason. (It’d be one thing to render a whole wad of HTML in a model, but a list of links is another thing…)

You’re exactly right about the reasons why there is no download_attachment_path helper there. Perhaps take a look at my latest reply (posted just now) to #34: it gives a tiny bit of code that’ll let you supply Fortitude with a helpers object that will give your widget access to whatever helpers you want — assuming you mix in the module (here, some module I know you can get access to that has all of your routes helpers in it).

It strikes me, looking at it, that Fortitude’s inline_html doesn’t let you pass in a RenderingContext for its internal call to to_html. I’ll try to add that, and keep this bug open for that. In the mean time, you can just call SomeWidgetClass.inline_subclass { … }.new(assigns).to_html(my_rendering_context), which does exactly the same thing.

from fortitude.

ageweke avatar ageweke commented on July 29, 2024

In 0.9.5, which I just released, #inline_html can take a second argument, a Fortitude::RenderingContext. While it’s impossible for Fortitude to magically make the case above “just work”, for the reasons referenced in here, this should make it about as easy as is possible.

from fortitude.

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.