Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7857 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Allow block usage of content_tag outside of ActionView Templates (in Helpers)

Reported by: michael.niessner Assigned to: core
Priority: normal Milestone: 1.x
Component: ActionPack Version: edge
Severity: normal Keywords: verified
Cc:

Description

http://dev.rubyonrails.org/ticket/7432 describes the problem that using content_tag with a block in a helper raises "undefined local variable or method `_erbout' for ...". The attached patch fixes this problem by checking if _erbout is defined in the passed block. If _erbout is not defined, the value of content_tag_string is returned instead of attempting to concat it to _erbout.

Attachments

allow_block_usage_of_content_tag_outside_of_action_view_templates.diff (1.8 kB) - added by michael.niessner on 03/18/07 21:50:07.

Change History

03/18/07 21:50:07 changed by michael.niessner

  • attachment allow_block_usage_of_content_tag_outside_of_action_view_templates.diff added.

03/18/07 23:26:53 changed by josh

  • keywords set to verified.

+1 Looks nice and tests pass.

03/21/07 22:40:23 changed by mmangino@elevatedrails.com

+1 Works for me and the tests pass

05/02/07 22:31:33 changed by david

  • status changed from new to closed.
  • resolution set to fixed.

Closed by [6652].