rondo_form icon indicating copy to clipboard operation
rondo_form copied to clipboard

Support passing locals

Open dirschn opened this issue 1 year ago • 4 comments

Couple things to say here- I noticed in cocoon they passed locals as part of html_options which didn't make sense to me, since they're completely separate. As such, I broke from the "cocoon-ness" of this gem to provide this functionality in a way that made the most sense to me. I will note however that this PR introduces breaking changes, which is likely the reason cocoon did it the way they did.

If you were to ask my opinion, I'd say to go with this implementation and merge it with a major version upgrade.

I can refactor to implement the way cocoon did, if you're very against this format, though.

I also renamed partial_name to partial to match Rails

I will add a documentation update with usage examples once I have your decision about what implementation you'd like to go with

dirschn avatar Aug 06 '24 01:08 dirschn

@dirschn Thanks for your contribution! I wonder what you want to do with render_options or the difference is between render_options and html_options. Please give a detailed guide about what developers can use with render_options

hungle00 avatar Aug 09 '24 03:08 hungle00

Sorry for the delay, been quite busy lately. I'd be happy to make some adjustments to the documentation to reflect the changes I've made here. I'll try to get that done in the next few days.

dirschn avatar Aug 13 '24 02:08 dirschn

I added a section to the read me with some documentation covering the view helpers in the style of the Rails api docs but to answer your question more specifically:

Prior to this PR, there is no way to pass local variables to the partial rendered by link_to_add_association. This PR adds that ability, using the render_options parameter. I also refactored partial_name to be passed in render_options (using partial like you would normally), rather than html_options, as it's only relevant to render. I thought about renaming html_options to link_to_options which would be a bit more descriptive to developers about what exactly it's for. Thoughts?

I hope this helps to clear it up a bit... Let me know if you need more explanation!

dirschn avatar Aug 22 '24 01:08 dirschn

Hi @hungle00! I'm just checking in to see whether you are waiting on more from me or if you're just busy? Totally fine if you're busy, I just want to make sure I'm not missing anything!

dirschn avatar Sep 13 '24 16:09 dirschn

Hi @hungle00! I'm just checking in to see whether you are waiting on more from me or if you're just busy? Totally fine if you're busy, I just want to make sure I'm not missing anything!

@dirschn Sorry. At that time you mentioned, I was very busy with company tasks and didn't have time for open source. After considering, I'll merge your PR and will release a new version soon. Thanks for your contribution.

hungle00 avatar Dec 05 '24 03:12 hungle00