can anyone help me understand this error. I am trying to create a contact form in rails, following the guide for creating web applications. I followed the steps to create an advertising scaffold. Then I corrected my routes. He then said to enable this in the message manager action.
if @message.save
flash[:notice] = 'Thanks for Your Message'
format.html { redirect_to root_path }
I did this and I get the following ActiveModel :: ForbiddenAttributesError error in MessagesController # create ActiveModel :: ForbiddenAttributesError
This is my message manager file
class MessagesController < InheritedResources::Base
def show
if @message.save
flash[:notice] = 'Thanks for Your Message'
format.html { redirect_to root_path }
end
end
end
My routes file is as follows
Resources: products resources: orders, only: [: new ,: create] #tells rails product identification number is required end
# get 'pages/payment'
get 'home/about'
get 'messages/new'
get 'seller' => "products#seller"
get 'sales' => "orders#sales"
get 'static_pages/productlanding'
get "content/veg"
get "content/fruit"
get "content/mix"
get 'subscriptions/new'
root 'static_pages#home'
Lilp