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

Ticket #10543 (closed defect: invalid)

Opened 7 months ago

Last modified 6 months ago

Markaby broken by Rails 2.0.2

Reported by: ccm682 Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: major Keywords: Markaby
Cc: rubyruy

Description

When Markaby and Rails 2.0.2 meet, there is a horrible head on collision. The issue is the following line 8 in rails.rb in the markaby distribution:

compile_and_render_template(template_extension, template, file_path, local_assigns)

but it can be fixed ismply by putting:

compile_and_render_template(@@template_handlers[template_extension.to_sym], template, file_path, local_assigns)

so the question is: Is this an error in Markaby or an error in ActionPack? If Markaby is changed to support Rails 2.0.2, will it not work with previous versions of Rails?

Attachments

markaby_fix.diff (1.7 kB) - added by rubyruy on 01/03/08 21:54:42.

Change History

12/19/07 02:30:00 changed by chuyeow

  • status changed from new to closed.
  • resolution set to invalid.
  • milestone changed from 2.0.2 to 2.x.

This is very likely an issue Markaby has to fix. Try posting a new issue on the Markaby Trac.

12/19/07 03:10:38 changed by josh

Yep yep... its kind of my fault.

I did the refactoring to ActionPack. However its not a bug. The Markaby folks should update their Rails Helper to use the new TemplateHandler subclass.

01/03/08 21:54:42 changed by rubyruy

  • attachment markaby_fix.diff added.

01/03/08 21:58:45 changed by rubyruy

That fix did not work for me. I still had the following error:

undefined method `compile' for #<Markaby::Rails::ActionViewTemplateHandler:0x2543740>

It doesn't look like the ActionView::Base over-write actually does anything useful any more, so just commenting it out was the first step.

Next problem was the render call signature which wants a template file path. Doesn't seem to actually be needed either so I made it optional. It might break error reporting or somesuch but it works.

And yes, this should probably go on the markaby trac but it seems to be offline now.

Now, anyone want to guess why the initial fix worked for the OP but not me?

01/03/08 21:59:02 changed by rubyruy

  • cc set to rubyruy.

01/22/08 23:20:23 changed by randypuro

Not sure why the initial fix works for some, but the markaby over-write was also mistakenly looking for template handlers by string (rather than symbols).

See http://code.whytheluckystiff.net/markaby/ticket/58 for an alternative patch which continues to support filename error reporting for markaby templates while falling back to the default rails render_template functionality for all other use cases (which properly supports mixing other templating plugins, cache support, etc).