【发布时间】:2014-03-17 03:52:41
【问题描述】:
我正在处理一个嵌套资源项目,并且在我的步骤控制器中出现错误:
def create
@step = Step.new(step_params)
respond_to do |f|
if @step.save
f.html { redirect_to @step, notice: 'Step was successfully created.' }
f.json { render action: 'show', status: :created, location: @step }
else
f.html { render action: 'new' }
f.json { render json: @step.errors, status: :unprocessable_entity }
end
end
end
我得到的错误是:
undefined method `step_url' for #<StepsController:0x007feeb6442198>
我的路线如下所示:
root 'lists#index'
resources :lists do
resources :steps
end
【问题讨论】:
标签: ruby-on-rails-4 ruby-1.9.3