plataformatec/show_for — Issue #30: do block problem
Author: Marmolin
Created: 2012-01-21 13:34:09+00:00
State: open

I also tested the possibility to change the outputted content which is a very important feature, but it is not working for me. Maybe I misunderstod the readme help. From the help I cut and pasted a changed version of the do feature as follows (I tried many variation of these blocks)

<%= show_for @user do |u| %>
<% u.association :groups, :collection_tag => :ol do |group| %>

<%= (" #{group.name}'hej'").html_safe %>

<% end %>

<%= u.association :relationships, :using => :related_user_role, :label=>'Fadder' %>
<% u.association :relationships do
@user.relationships.map(&:user_role).to_sentence
end %>

<% u.attribute :gender do %>
<%= (" #{@user.gender}'hej'").html_safe %>
<% end %>

<% end %>
The result is that nothing is rendered when using do ... but it is OK when i just use the simple form as e.g. <%= u.attribute :gender %>