0

I haven't been able to find a solution elsewhere. This is the code I'd like to work:

<%= render :layout => "l/run" do %><%-
     content_for :error do
   -%>Error - Missing arguments<%-
     end -%>
<%=  render :inline => @api.data.views["html"], :locals => {:result => @result} %>
<%- end -%>

and in l/run:

<%-
...
  if readQuery.value?(nil)
-%><%= yield :error %><%-
  else
...
-%><%= yield %><%-
...
  end
-%>

I feel like this approach should work but am stumped.

4

1 回答 1

0

Normally this should work

view1.html.erb

<%= yield :error%>

view2.html.erb

<% content_for :error do %>
  #your code
<% end %> 
于 2012-12-31T04:57:37.030 回答