PhoenixFramework icon indicating copy to clipboard operation
PhoenixFramework copied to clipboard

教程中代码片段的形式调查

Open chenxsan opened this issue 8 years ago • 2 comments

目前教程中涉及的代码片段都是 git log -p 的结果,示例如下:

diff --git a/web/controllers/recipe_controller.ex b/web/controllers/recipe_controller.ex
index 96a0276..832ca52 100644
--- a/web/controllers/recipe_controller.ex
+++ b/web/controllers/recipe_controller.ex
@@ -1,5 +1,6 @@
 defmodule TvRecipe.RecipeController do
   use TvRecipe.Web, :controller
+  plug :login_require when action in [:new, :create, :edit, :update, :delete]

   alias TvRecipe.Recipe

不知道这样的形式有没有问题。

如果觉得能接受,请点击 +1,无法接受,请点击 -1。

或者有其它建议,可以附在评论中。

cc @torghay, @nanlong.

chenxsan avatar Feb 06 '17 15:02 chenxsan

+1

在 2017-02-06 23:39:44,"陈三" [email protected] 写道:

目前教程中涉及的代码片段都是 git log -p 的结果,示例如下:

diff --git a/web/controllers/recipe_controller.ex b/web/controllers/recipe_controller.ex index 96a0276..832ca52 100644--- a/web/controllers/recipe_controller.ex +++ b/web/controllers/recipe_controller.ex @@ -1,5+1,6 @@ defmoduleTvRecipe.RecipeControllerdouseTvRecipe.Web, :controller+ plug :login_requirewhen action in [:new, :create, :edit, :update, :delete]

aliasTvRecipe.Recipe

不知道这样的形式有没有问题。

如果觉得能接受,请点击 +1,无法接受,请点击 -1。

或者有其它建议,可以附在评论中。

cc @torghay, @nanlong.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

torghay avatar Feb 07 '17 07:02 torghay

+1

nanlong avatar Feb 11 '17 09:02 nanlong