So everything was working earlier. I cut a branch and made some changes that I didn't think would affect this poster attribute but I got this error. I switched to master and did not merge anything, and this was working before I cut the branch I mention above. And I got this error also.
I'm not sure what happened, maybe I twitched and put in a keystroke somewhere but I can't see it.
It says the error is in my restaurants controller. I'm using the poster attribute in my show.index.html.
show.index.html:
<% @restaurant.reviews.reverse.each do |review| %>
posted by: <%= review.poster %><br />
written: <%= time_ago_in_words(review.created_at) %> ago<br />
Review:<br />
<%= review.article %><br /><br />
<% end %>
The method for review in my restaurants_controller.rb:
def review
@restaurant.reviews << Review.create!(review_params) ## <= this is the offending piece of code
redirect_to :action => "show", :id => params[:id]
end
The method for review_params in restaurants_controller.rb:
def review_params
params.require(:review).permit(:poster, :article)
end
I'm not sure what changed to make me get unknown attribute but if someone could help I'd appreciate it.
Thanks!