We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No description provided.
The text was updated successfully, but these errors were encountered:
【来自ray16897188】 就那groups的来说:
def create @group = Group.new(group_params) #根据你页面(view)发过来的参数,创建一个新的group数据条目(model) @group.user = current_user #把这条group条目的user属性设置成当前的用户current_user if @group.save #尝试把这个group条目存到数据库(sqlite3)中,如果存成功了的话就 current_user.join!(@group) #把这个group添加到当前用户所加入的groups中去 redirect_to groups_path #再让页面返回到所有群组列表的那个页面 else #如果存失败了(比如validates没有通过,就不会把这条group数据条目存到sqlite3数据库中)那么就 render :new #直接让页面再显示创建新群组的那个页面 end end
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: