0
- content_for :logo, render('logo', :obj => @sites_page)

raise_logo.html.haml で

-raise local_variables.inspect
= link_to popup_information_path(obj.class.short_name, obj), :remote => true do
    - image_tag(obj.user.avatar.url)

ローカル変数 obj が存在することを示します

[:local_assigns, :output_buffer, :_old_virtual_path, :_old_output_buffer,
:logo, :obj, :_hamlout, :_erbout, :__in_erb_template, :name, :url,  
:path, :haml_temp]

raiseしかし、不満はありません:

undefined local variable or method `obj' for #<#<Class:0xadcdb88>:0x9cc9fd0>

Extracted source (around line #1):

1: = link_to popup_information_path(obj.class.short_name, obj), :remote => true do
2:     - image_tag(obj.user.avatar.url)
4

1 に答える 1

1

試してみる- content_for :logo, render(:partial => 'logo', :locals => {:obj => @sites_page})

于 2013-04-26T15:36:47.747 に答える