Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

render partial collection with inline spacer

#1014

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 => ', '


Reported by Maxim Kulkin · September 10th, 2008 @ 08:11 PM

State: wontfix
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Maxim Kulkin
  2. Maxim Kulkin
    Maxim Kulkin
    • Title changed from render partial collection with inline spacer to [PATCH] render partial collection with inline spacer

    September 10th, 2008 @ 08:40 PM

  3. josh
    josh
    • 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?

    September 11th, 2008 @ 04:39 PM

  4. Maxim Kulkin
    Maxim Kulkin

    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 ?

    September 11th, 2008 @ 08:20 PM

  5. josh
    josh

    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.

    September 12th, 2008 @ 01:49 AM

  6. Pratik
    Pratik
    • 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,

    September 12th, 2008 @ 08:48 AM