aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/engines.md
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2013-09-07 01:33:19 -0700
committerXavier Noria <fxn@hashref.com>2013-09-07 01:33:19 -0700
commitc989a18a74d970be86c537766f14916bd06fe176 (patch)
treecf2ab71e426364c6b82e884b00146acf1345abc1 /guides/source/engines.md
parent6a91a3307ff6556225ab8717617074cea20222e0 (diff)
parent2c8bc2cdcdb7b144b7a583d24922fd8064bcff3d (diff)
downloadrails-c989a18a74d970be86c537766f14916bd06fe176.tar.gz
rails-c989a18a74d970be86c537766f14916bd06fe176.tar.bz2
rails-c989a18a74d970be86c537766f14916bd06fe176.zip
Merge pull request #12155 from jetthoughts/reformat_guides_code_examples
Use Ruby on Rails Coding Conventions for code examples in the guides
Diffstat (limited to 'guides/source/engines.md')
-rw-r--r--guides/source/engines.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/guides/source/engines.md b/guides/source/engines.md
index bc404ccb7f..ec51fb9234 100644
--- a/guides/source/engines.md
+++ b/guides/source/engines.md
@@ -399,9 +399,9 @@ def create
end
private
-def comment_params
- params.require(:comment).permit(:text)
-end
+ def comment_params
+ params.require(:comment).permit(:text)
+ end
```
This is the final part required to get the new comment form working. Displaying the comments however, is not quite right yet. If you were to create a comment right now you would see this error:
@@ -850,7 +850,6 @@ module Blorgh::Concerns::Models::Post
before_save :set_author
private
-
def set_author
self.author = User.find_or_create_by(name: author_name)
end