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

Render_async on header #115

Closed
deikka opened this issue May 10, 2020 · 2 comments
Closed

Render_async on header #115

deikka opened this issue May 10, 2020 · 2 comments
Labels

Comments

@deikka
Copy link

deikka commented May 10, 2020

Hi!

I am trying to load a partial in the header and it doesn't load. If I put the code in the view, it does.

Header partial:
<%= render_async notifications.notifications_count_path %>

Controller (notifications engine, maybe this is not ok):

def notifications_count @notif_count = Notification.unread_count(current_user) render partial: 'layouts/notifications_count' end
Inside my routes:

Notifications::Engine.routes.draw do get :notifications_count, controller: :notifications end

Am I doing something wrong?

Thanks in advance!

@nikolalsvk
Copy link
Owner

Hey, @deikka, thanks for submitting an issue! Did you try adding <%= content_for :render_async %> inside <header> tag?

@deikka
Copy link
Author

deikka commented May 10, 2020

wow, that's fast! Thanks for the tip, now it's working :)
The conten_for was in application.html.erb inside head tag.

thanks again!!

@deikka deikka closed this as completed May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants