阅读背景:

Ruby on Rails:如果帖子没有保存,我将如何留在同一页面?

来源:互联网 
def create
    @addpost = Post.new params[:data]
    if @addpost.save
        flash[:notice] = "Post has been saved successfully."
        redirect_to posts_path
    else
        flash[:notice] = "Post can not be saved, please enter information."
    end
end
def create
    @addpost = Post.new params[:data



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: