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

Update _tags_popover.html.erb #1

Closed
wants to merge 1 commit into from
Closed

Conversation

shubhi2000
Copy link
Owner

@shubhi2000 shubhi2000 commented Mar 20, 2019

Fixes publiclab#5021 (<=== Add issue number here)

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@shubhi2000 shubhi2000 marked this pull request as ready for review March 20, 2019 04:20
@shubhi2000 shubhi2000 closed this Mar 20, 2019
@@ -1,6 +1,7 @@
<div class="main_div">
<p class="small_heading"> Follow related tags: </p>
<%= form_with remote: true, url: '/subscribe/multiple/tag' do |f| %>
<% unless tags.nil? %>
<% tags.each do |tag| %>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @shubhi2000. I know this PR has been closed, but there's a shorter way to check for existence of tags:

<% tags && tags.each do |tag| %>

The first tags will return false if tags is nil, and true if it isn't. The && operator tells Ruby to execute the command on the right only if the command on the left returns true

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madeofhuman I'll take care of it from next time onwards. Thank you so much :)

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