Rails - Redundant RESTFUL Actions for map.resources? (new, create)
问题 I was wondering why when you create restful routes in rails with map.resources it generates actions for new, create, edit, update ? Is there anything wrong in declaring just one action for create and update and do something like this? def create unless post? @user = User.new else redirect_to :action => 'index' if user.create(params[:user]) end end so we could have something like :GET users/create # to show the form (same as action - new) :POST users/create # to create a new user since Restful