html - Contact form not displaying on the page -
hey trying create contact page rails app. created contact model:
class contact < activerecord::base end
a contact controller:
class contactscontroller < applicationcontroller skip_after_action :verify_authorized def new @contact = contact.new end def create end end
ran migration :
class createcontacts < activerecord::migration def change create_table :contacts |t| t.string :email t.string :object t.text :content t.timestamps null: false end end end
i created route
resources :contacts, only: [:new, :create]
and created view:
<div class="banner"> <div class="container"> <div class= "col-xs-12"> <%simple_form_for @contact |t|%> <%= t.error_notification %> <%= t.input :email, label: 'votre email' %> <%= t.input :object, label: 'objet' %> <%= t.input :content, label: 'votre message' %> <%= t.button :submit, value: "soumettre ce tournoi à validation", class: "btn-primary marge-bas" %> <% end -%> </div> </div></div>
the link contacts/new works fine contact form not displaying on page.
it should <%=simple_form_for @contact |t|%>
Comments
Post a Comment