map.resources を使用してレールで安らかなルートを作成すると、new、create、edit、update のアクションが生成されるのはなぜですか? createとupdateのアクションを 1 つだけ宣言し て、このようなことを行うことに何か問題がありますか?
def create
unless post?
@user = User.new
else
redirect_to :action => 'index' if user.create(params[:user])
end
end
だから私たちは次のようなものを持つことができます
:GET users/create # to show the form (same as action - new)
:POST users/create # to create a new user
Restful は動詞に基づいているため、これが最適なアプローチではないでしょうか?
ご清聴ありがとうございました