<% unless blocks.nil? || blocks.empty? %> <% blocks.each do |block_name| %> <% next unless MyController.available_blocks.keys.include? block_name %> <% if edit %> <%= render partial: "my/block", locals: { block_name: block_name, user: @user } %> <% else %>
<%= render partial: "my/blocks/#{block_name}", locals: { user: @user } %>
<% end %> <% end %> <% end %>