Skip to content

Close if empty html#124

Open
elalemanyo wants to merge 3 commits intoafcapel:mainfrom
elalemanyo:feature/close_if_empty_html
Open

Close if empty html#124
elalemanyo wants to merge 3 commits intoafcapel:mainfrom
elalemanyo:feature/close_if_empty_html

Conversation

@elalemanyo
Copy link
Copy Markdown

@elalemanyo elalemanyo commented Nov 16, 2022

I think it makes more sense to open the results only when there are results. In my case, this resulted in some style inconsistencies.

shot2022-11-16 at 16 37 59@2x

@netlify
Copy link
Copy Markdown

netlify bot commented Nov 16, 2022

Deploy Preview for stimulus-autocomplete ready!

Name Link
🔨 Latest commit b3e3f3d
🔍 Latest deploy log https://app.netlify.com/sites/stimulus-autocomplete/deploys/63eaa6f44d08750008fcd686
😎 Deploy Preview https://deploy-preview-124--stimulus-autocomplete.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@elalemanyo
Copy link
Copy Markdown
Author

@ACPK
Copy link
Copy Markdown

ACPK commented Mar 1, 2023

@elalemanyo Yes but the Rails example should be updated to reflect the change.

I found that HTML (from this PR) returns true due to a code comment with the name of the controller.

Doesn't work: render layout: false if !@results.present?

It could be resolved in Rails 7 by adding the following code to the controller.

Works: head 200, content_type: "text/html" if !@results.present?

@elalemanyo
Copy link
Copy Markdown
Author

@afcapel Is there any possibility to merge this? We believe it could be of interest to other users.
Thanks

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.

2 participants