Sha256: 205fd3a21cfea291e6a13ff2ffdf2cb83e1e01aa40991423600fde0771c6b0a6
Contents?: true
Size: 491 Bytes
Versions: 53
Compression:
Stored size: 491 Bytes
Contents
class CommentsController < ApplicationController def create # $xvars['p'] is the query parameters like params in rails guide: # private # def comment_params # params.require(:comment).permit(:commenter, :body) # end # @article = Article.find($xvars['p']['comment']['article_id']) @comment = @article.comments.new( body: $xvars['p']['comment']['body'], user_id: $xvars["user_id"]) @comment.save! end end
Version data entries
53 entries across 53 versions & 3 rubygems