2つのリストアクションを実行しました。1つは実際にはデフォルトの_newアクションに対応し、もう1つはわずかに異なります。したがって、generator.ymlに次のように記述します。
list:
max_per_page: 10
title: All Posters
display: [approved, name, user_id, _web_path, created_at]
actions:
upload : #this is actually equivalent to _new.
credentials: create_poster
label: "Upload Poster"
action: new
create :
credentials: create_poster
label: "Create Poster"
リストビューに、これら2つのアクションの2つのリンクが表示されますが、createLinkは/poster/ListCreateではなく/poster/ ListCreate/actionにリンクしています 。その理由は何でしょうか?また、_list_actions.phpファイルをキャッシュに貼り付けています。
<li class="sf_admin_action_upload">
<?php if ($sf_user->hasCredential('create_poster')): ?>
<?php echo link_to(__('Upload Poster', array(), 'messages'), 'poster/new', array()) ?>
<?php endif; ?>
</li>
<li class="sf_admin_action_create">
<?php if ($sf_user->hasCredential('create_poster')): ?>
<?php echo link_to(__('Create Poster', array(), 'messages'), 'poster/create', array()) ?>
<?php endif; ?>
</li>