1.7.56. User ドロップ (up)

<h2>User {{ user.display_name }}</h2>
Account {{ user.account.name }}
Username {{ user.username }}
Email {{ user.email }}
Website {{ user.website }}

1.7.56.1. メソッド

1.7.56.1.1. errors

送付に失敗した後にこのモデルのフォームがレンダリングされると、発生したエラーを返します。

{{ user.errors.name | inline_errors }}
1.7.56.1.2. admin?

ユーザーが管理者かどうかを返します。

{% if user.admin? %}
  <p>You are an admin of your account.</p>
{% endif %}
1.7.56.1.3. username

ユーザーのユーザー名を返します (html エスケープ)。

1.7.56.1.4. アカウント

ユーザーのアカウントを返します。

1.7.56.1.5. name

ユーザーの苗字および名前を返します。

1.7.56.1.6. email

ユーザーのメールアドレスを返します。

1.7.56.1.7. password_required?

このメソッドは、組み込みのデベロッパーポータルの認証メカニズムを使用するユーザーの場合は true を返し、Janrain、CAS、またはその他のシングルサインオンメソッドで認証されるユーザーの場合は false を返します。

{% if user.password_required? %}


{% endif %}
1.7.56.1.8. sections

ユーザーがアクセスすることのできるセクションのリストを返します。

{% if user.sections.size > 0 %}
  <p>You can access following sections of our portal:</p>
   <ul>
    {% for section in user.sections %}
      <li>{{ section }}</li>
    {% endfor %}
  </ul>
{% endif %}
1.7.56.1.9. role

ユーザーのロールを返します。

1.7.56.1.10. roles_collection

ユーザーが利用可能なロールのリストを返します。

{% for role in user.roles_collection %}
  <li>
    <label for="user_role_{{ role.key }}">

      {{ role.text&nbsp;}}
    </label>
    </li>
  {% endfor %}
1.7.56.1.11. url

ユーザーのリソース URL を返します。

{{ 'Delete' | delete_button: user.url }}
1.7.56.1.12. edit_url

ユーザーを編集するための URL を返します。

{{ 'Edit' | link_to: user.edit_url, title: 'Edit', class: 'action edit' }}
1.7.56.1.13. can

パーミッションメソッドへのアクセス権限を付与します。

{% if user.can.be_managed? %}
  <!-- do something -->
{% endif %}
1.7.56.1.14. extra_fields

このユーザーの非表示ではない追加フィールドを値と共に返します (例: すべての追加フィールドを表示する)。

{% for field in user.extra_fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
1.7.56.1.15. fields

このユーザーのすべてのフィールドを値と共に返します (例: すべてのフィールドを表示する)。

{% for field in user.fields %}
  {{ field.label }}: {{ field.value }}
{% endfor %}
1.7.56.1.16. builtin_fields

このユーザーのすべての組み込みフィールドを値と共に返します。