PhoenixFramework
PhoenixFramework copied to clipboard
教程中代码片段的形式调查
目前教程中涉及的代码片段都是 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.
+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.
+1