So, I have a controller action similar to this:
def create
@term = Term.new(term_params)
if @term.save
redirect_to(@term)
else
render :new
end
end
When the check fails, a new view of the actions is displayed, and the user can see the errors that were made. The problem is that this also changes the URL to localhost:3000/terms, so when for some reason the user wants to refresh the page, then the rails will want to redirect that user to the pages index. Is there an easy way to keep the user on the page new termafter the update?
In fact, I do not have a page indexfor terms, because I do not need this, so this whole situation will cause an error in this case.
source
share