So I have a controller action looking like this:
def create
@term = Term.new(term_params)
if @term.save
redirect_to(@term)
else
render :new
end
end
When validation fails the new actions view is rendered and user can see the errors that were made. The problem is that this also changes the URL to localhost:3000/terms
so when the user would for some reason want to refresh the page, then rails would want to redirect that user to terms index
page. Is there a simple way to keep the user on the new term
page after refresh?
I actually don't have a index
page for terms
as I dont't need it, so this whole situation will throw an error in this case.
render
it will show create url only.