<% @preference.blog_preference ||= BlogPreference.new  %>
<% f.fields_for :blog_preference do |bpf|  %>
  <% if view_type == :form %>
    <tr>
      <th>[<%=h BlogPreference.human_attribute_name("visibility") %>]</th>
      <td>
        <% %w(friend_only member_only publiced).each do |name| %>
          <% value = BlogPreference::VISIBILITIES[name.to_sym]  %>
          <%= bpf.radio_button :visibility, value %>
          <%= bpf.label "visibility_#{value}", t("blog.blog_preference.visibility_label.#{name}") %>
        <% end %>
      </td>
    </tr>
  <% else %>
    <tr>
      <th>[<%=h BlogPreference.human_attribute_name("visibility") %>]</th>
      <td>
        <%=h t("blog.blog_preference.visibility_label.#{@preference.blog_preference.visibility_name}") %>
        <%= bpf.hidden_field :visibility %>
      </td>
    </tr>
  <% end %>
<% end %>
