aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/engines.md
diff options
context:
space:
mode:
authorPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-09-06 21:41:04 +0300
committerPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-09-06 21:42:29 +0300
commit2c8bc2cdcdb7b144b7a583d24922fd8064bcff3d (patch)
tree279e76293ba90dcc46e7716ecf78fbc1df221e79 /guides/source/engines.md
parent97a19c6b4b71d1e12d62d880ec8c8eed357b3d3c (diff)
downloadrails-2c8bc2cdcdb7b144b7a583d24922fd8064bcff3d.tar.gz
rails-2c8bc2cdcdb7b144b7a583d24922fd8064bcff3d.tar.bz2
rails-2c8bc2cdcdb7b144b7a583d24922fd8064bcff3d.zip
Use Ruby on Rails Coding Conventions for code examples in the guides
* Indent after private/protected * Ruby >= 1.9 syntax for hashes * Prefer method { do_stuff } instead of method{do_stuff} for single-line blocks. [ci skip]
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