我使用的是wicked gem 在我點擊RequestStepsController#update後,我被重定向到/ request_steps/wicked_finish。我不知道爲什麼。有什麼建議麼? 如果它按照我的預期工作,那麼更新對象後的下一步是:the_frame,如步驟中所述。邪惡的精靈寶石忽略我的步驟並跳轉到request_steps/wicked_finish
從日誌:
Started PUT "/request_steps/77" for 127.0.0.1 Processing by RequestStepsController#update as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"XXX", "request"=>{"background_information"=>"prefilled"}, "commit"=>"C 7"} Redirected to http://localhost:3000/request_steps/wicked_finish Started GET "/request_steps/wicked_finish" for 127.0.0.1 Processing by RequestStepsController#show as HTML Parameters: {"id"=>"wicked_finish"} Completed 404 Not Found in 180ms ActiveRecord::RecordNotFound - Couldn't find Request without an ID:
這是我RequestStepsController
類RequestStepsController < ApplicationController的 包括妖獸::嚮導
steps :background_information,
:no_list_what_can_go_wrong,
:the_frame,
:select_group
def show
@request = Request.find(params[:request])
render_wizard
end
def update
@request = Request.find(params[:id])
@request.update_attributes(request_params)
render_wizard @request
end
def request_params
params.require(:request).permit(:title, :description, :goal,
:request_group_id,
:repository_url,
:background_information
)
end
末
這是我的表格:
= simple_form_for(@request, url: wizard_path(@request), method: :put, :html => { :class => 'form-inline span8 help_text' }) do |f|
謝謝,建築 - 部分對象 - 分步維基頁面解釋了我需要的內容。 – martins