あなたのページコントローラでそれを行うことができます
if current_user and current_user.id != 22
...
またはbefore_filter
、ページコントローラーで
before_filter :check_for_specific_user, :only => [:create, :update]
def check_for_specific_user
if current_user and current_user.id == 22
# redirect or something
end
end
または、アプリケーションコントローラーで次のように実行することもできます
before_filter :check_for_specific_user
def check_for_specific_user
if params[:controller] == 'pages' and ['create', 'update'].include? params[:action] and current_user and current_user.id == 22
# redirect or something
end
end
また、アプリケーション コントローラに次のようなメソッドを用意することをお勧めします。
def admin?
current_user and current_user.id == 22
end
次に、ページコントローラーで、次のように書くことができます
if admin?
# ...
end