This project is archived and is in readonly mode.
Add content_exists? to ActionView::Helpers::CaptureHelper
-
Pratik
- Tag changed from actionview, capturehelper to actionview, capturehelper, patch
- State changed from new to wontfix
- Assigned user set to Pratik
- Title changed from [PATCH] add content_exists? to ActionView::Helpers::CaptureHelper to Add content_exists? to ActionView::Helpers::CaptureHelper
Missing patch. Also, using content_exists? looks like code smell. Probably you should discuss this in the mailing list, see if anyone else finds it useful.
Thanks!
-
Norman Clarke
Oops, sorry for the lack of patchiness.
The problem is, I'm unaware of any other way to check if a named content block has been set in a content_for block other than looking for a framework-internal instance variable: @conent_for_[content_name]. The patch simply adds a wrapper method that checks for this variable in order to provide a stable API method.
Having no sane way to check for a named content block is a pain because AFAIK it leaves you without an elegant way to provide for an overrideable default.
I'll take it up on the list and see what people think.
