I am trying to submit some data to db and its ok but when i am trying to retrieve those data show that Couldn\'t find Article without an ID.ils 4.0.1. I am using ruby 2.0.0 and
You are redirecting before actually saving your article.
This:
def create
@article = Article.new(article_params)
redirect_to @article
@article.save
end
should be:
def create
@article = Article.new(article_params)
@article.save
redirect_to @article
end
And if you want to add some error handling as well:
def create
@article = Article.new(article_params)
if @article.save
redirect_to @article
else
render :new
end