Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a template for failed new diary comment validation #4634

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AntonKhorev
Copy link
Contributor

@AntonKhorev AntonKhorev commented Mar 29, 2024

Here's a problem* that I came across when trying to create a controller for diary comments.

You write a comment for a diary entry, submit it and it fails the validation. Currently it's difficult to fail the validation, because empty comments are prevented client-side and it's difficult to type special characters that are disallowed. But let's suppose the validation failed. We have a branch for it:

It just renders the diary entry page again. You'll be looking at the top of the page, not where the comment form is. And the entered comment is reset:

<%= bootstrap_form_for @entry.comments.new, :url => { :action => "comment" } do |f| %>

Here I'm showing a different page instead. It is similar to subscribe/unsubscribe pages and has a comment form that keeps the previously entered comment.

image


* The actual problem was that with a diary comments controller I'd have to render the show action of another controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant