Please sign in to comment.
Render blog post on create page
To get the blog post content rendered in the view, we attempt to create a new BlogPost instance with the passed-in form params. We don't yet attempt to save it to the database because the acceptance test hasn't led us there yet. All it's said is that we need an object on the `create` page that responds to a `title` method (and a `body` method). That doesn't require us to save anything to the database: all that requires is us instantiating an object. Outer red: ActiveModel::ForbiddenAttributesError Attempting to instantiate a BlogPost leads to a new error: Rails' "strong parameters" security feature means that we can't just pass user-submitted params directly into a model; that could result in users hacking our system by setting fields they shouldn't be able to, like the user a post belongs to.
- Loading branch information...
Showing with 6 additions and 1 deletion.