これが以前に答えられたかどうかわからない。
ユーザーへのカスタムルートを用意します。ユーザーに直接アクセスすると/users/5すべてが機能します。宣言型認証で/profileまたは/users/ current_userを試してみると、「IDのないユーザーが見つかりませんでした」というメッセージが表示されます。
map.profile "profile", :controller => "users", :action => "show"
map.edit_profile 'profile/edit', :controller => 'users', :action => 'edit', :conditions => { :method => :get }
私のApplicationControllerには
before_filter {| c | Authorization.current_user = c.current_user}
そして、私のauthorization_rulesにはuser.idがあり、current_user.idも試しました。
role :user do
includes :guest
has_permission_on :users, :to => [:show, :edit ] do
if_attribute :id => is { user.id }
end
end
私は何が間違っているのですか?