我有2個控制器:Projects
和Users
。兩種模式根本沒有關係。Rails 3 - Redirect_to /渲染另一個控制器
當我創建一個新的Project
我要保存新project
後重定向到new User path
,但我所有的嘗試給像缺少模板或類似的東西誤差修改。
我該如何得到這個工作?
EDITED
我在Projects
控制器創建方法:
DEF創建
@project = Project.new(PARAMS [:項目])
respond_to do |format|
if @project.save
format.html { render (new_user_registration_path) }
else
format.html { render :action => "new" }
format.xml { render :xml => @project.errors, :status => :unprocessable_entity }
end
end
端
你可以發佈你正在嘗試使用的代碼? –
添加stacktrace到你的問題 – lucapette