Strange AbstractController::ActionNotFound Error with update method in Rails

后端 未结 2 1455
走了就别回头了
走了就别回头了 2021-01-16 01:22

I have FamiliesController with these actions:

def edit
 @family=Family.find(params[:id])
end

def update
    @family=Family.find(params[:i         


        
2条回答
  •  -上瘾入骨i
    2021-01-16 01:56

    Rails does not support alphanumeric IDs by default, it expects an integer.

    If you need to make the IDs alphanumeric, you need to make some changes. Please look at the following resources:

    • Altering the primary key in Rails to be a string

    • http://railscasts.com/episodes/63-model-name-in-url-revised

    • http://railscasts.com/episodes/314-pretty-urls-with-friendlyid

提交回复
热议问题