Rails在一个新的控制器中组合RESTful方法 [英] Rails combining RESTful methods in a new controller

查看:182
本文介绍了Rails在一个新的控制器中组合RESTful方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个rails应用程序用户创建项目。目前这些是嵌套的,并且作为单独的动作完成(A user 注册,然后从项目新的项目)。

I have a rails app where users create projects. Currently these are nested, and are completed as separate actions (A user registers, and then from the project dashboard creates a new project).

为了提高转换次数一个新视图 getting_started ,其中用户将注册并创建一个项目从单个视图一步。

To improve conversions (as well as track conversions from adwords and facebook) I want to create a new view called getting_started whereby a user will register and create a project in one step from a single view.

根据最佳实践,我应该为此创建一个新的控制器,而不是只是拍摄一个新的视图

In terms of best practice, should I create a new controller for this, rather than just slapping a new view in users?

推荐答案

我在这个领域不是很有经验,就像我工作,

I 'm not very experienced in this field but as far as I worked,

为一个单一的函数创建一个新的控制器,即gets_started是100%相关现有的控制器没有意义。
我会建议放在现有的控制器中。

To create a new controller for a single function, i.e getting_started which is 100% related to an existing controller doesn't make sense. I 'll advise to place in the existing controller.

如果我们谈论效率,这些将需要完全相同的时间。

If we talk about efficiency, these will take exactly same time.

这篇关于Rails在一个新的控制器中组合RESTful方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆