Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么在groups_controller里可以在redirect_to xxx_path之后直接写", notice: “XXX””就可以出现,但在current_user.join!(@group)之后直接写就不行? #77

Open
dyz2102 opened this issue Oct 24, 2016 · 1 comment

Comments

@dyz2102
Copy link

dyz2102 commented Oct 24, 2016

No description provided.

@dyz2102
Copy link
Author

dyz2102 commented Oct 24, 2016

【来自ray16897188】因为redirect_to这是rails里预设的函数,它是可以接受notice: “XXX”这个参数,并且做出相应显示flash的操作的。

而join!这个函数是你自己写的,它只接受一个@group参数,你再传给它notice: “XXX”这个参数,它就直接把这个参数忽略掉了。

可以看一下Ruby语言的函数那一部分

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant