This project is archived and is in readonly mode.

#1014 ✓wontfix
Maxim Kulkin

render partial collection with inline spacer

Reported by Maxim Kulkin | September 10th, 2008 @ 08:11 PM | in 2.x

Render partial collection with :spacer_template is great but sometimes creating a separate partial for spacer is too much overhead. This patch introduces :spacer option to supply spacer text inline.

Usage: @@@ruby render :partial => 'item', :collection => @items, :spacer => ', '


Comments and changes to this ticket

  • Maxim Kulkin
  • Maxim Kulkin

    Maxim Kulkin September 10th, 2008 @ 08:40 PM

    • Title changed from “render partial collection with inline spacer” to “[PATCH] render partial collection with inline spacer”
  • josh

    josh September 11th, 2008 @ 04:39 PM

    • Assigned user set to “Pratik”

    I think it would be nicer just to type check "options[:spacer_template].is_a?(String)"

    @Pratik Are spacer templates going away?

  • Maxim Kulkin

    Maxim Kulkin September 11th, 2008 @ 08:20 PM

    Checking type of options[:spacer_template] won't work because both partial name and inline spacer are strings, so it won't be possible to distinguish those two. Also, that _template suffix is not ideal for naming inline spacer. I was also considering :spacer_inline or :spacer_text as alternatives.

    If you plan to move spacer templates away, what should be used instead ? Or render partial collection will also be deprecated ?

  • josh

    josh September 12th, 2008 @ 01:49 AM

    Duh! of course they are both strings :)

    I think the :spacer_template was going be moved into a plugin or something, not totally sure. Waiting for Pratik's response.

  • Pratik

    Pratik September 12th, 2008 @ 08:48 AM

    • Title changed from “[PATCH] render partial collection with inline spacer” to “render partial collection with inline spacer”
    • State changed from “new” to “wontfix”

    Hey,

    Plan is to deprecate spacer templates and move them to plugins. Josh/Ryan also did some refactoring to make writing plugin easier. #830 and #881 are relevant tickets,

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages