When I try to submit the form its giving me the error
No route matches [POST] \"/articles/new\"
the files are: new.html.erb
this file
Your actions/methods in the controller do nothing. It should be something like:
class ArticlesController < ApplicationController
def new
@article = Article.new
end
def create
@article = Article.new(article_params)
if @article.save
redirect_to @article
else
render 'new'
end
end
private
def article_params
params.require(:article).permit()# here go you parameters for an article
end
end
In the view:
<%= form_for @article do |f| %>