Thanks! This should be fixed in trunk. It was (erroneously) running a
function that was expecting Haml, but got ERB instead.
- Nathan
bhbrinckerhoff wrote:
> Yes, I saw this problem as well. It happened for me when trying to add
> an form in rhtml after including a partial written in haml.
>
> Ruby version: 1.8.5 [i686-darwin8.8.1]
> Rails version: Rails 1.2.3
> Haml version: Revision 510
>
> Repro
> ---------------------
> test_controller.rb:
> class TestController < ApplicationController
> def test
> end
> end
>
> _testpartial.haml:
> = item
>
> test.rhtml:
> Test
> <%= render :partial => 'testpartial', :object => nil, :locals =>
> {:item => "foo"} %>
>
> <% form_tag :controller => 'test', :action => 'test' do %>
> <%= submit_tag 'Button' %>
> <% end %>
>
> --------
> Note that the above code works fine. However, if you indent the
> following lines
>
> <% form_tag :controller => 'test', :action => 'test' do %>
> <%= submit_tag 'Button' %>
> <% end %>
>
> you get the following error
>
> ArgumentError in Test#test
>
> Showing app/views/test/test.rhtml where line #4 raised:
>
> comparison of Fixnum with nil failed
>
> Extracted source (around line #4):
>
> 1: Test
> 2: <%= render :partial => 'testpartial', :object => nil, :locals =>
> {:item => "foo"} %>
> 3:
> 4: <% form_tag :controller => 'test', :action => 'test' do %>
> 5: <%= submit_tag 'Button' %>
> 6: <% end %>
> 7:
>
> RAILS_ROOT: script/../config/..
> Application Trace | Framework Trace | Full Trace
>
> /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
> active_support/whiny_nil.rb:35:in `>'
> vendor/plugins/haml/lib/haml/helpers.rb:300:in
> `capture_erb_with_buffer'
> vendor/plugins/haml/lib/haml/helpers.rb:297:in `each'
> vendor/plugins/haml/lib/haml/helpers.rb:297:in
> `capture_erb_with_buffer'
> /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> helpers/capture_helper.rb:67:in `capture'
> /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
> helpers/form_tag_helper.rb:51:in `form_tag_without_haml'
> vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb:57:in
> `form_tag'
> #{RAILS_ROOT}/app/views/test/test.rhtml:4:in
> `_run_rhtml_47app47views47test47test46rhtml'
>
>
>
>
>
>
>
> On Apr 17, 7:11 am, ridcully <[EMAIL PROTECTED]> wrote:
>
>> I just found another problem:
>>
>> Try rendering a rhtml partial inside a haml template, where the
>> partial contains a form tag that is indented:
>>
>> foo.haml
>> --------------------
>> = render :partial => "bar"
>>
>> bar.rhtml
>> --------------------
>> #mind the indentation! without it, it works
>> <% form_tag do %>
>> <% end %>
>>
>> produces an ArgumentError (comparison ofFixnumwithnilfailed)
>>
>> - Andi
>>
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---