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

Use render collection to for main page #2083

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/dashboard/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
%h2.h3.mb-4= t('homepage.events.upcoming')
- @upcoming_workshops.each do |date, workshops|
%h3.h5= date
= render workshops
= render collection: workshops, partial: "events/event"
Copy link
Contributor

@matyikriszta matyikriszta Jul 1, 2024

Choose a reason for hiding this comment

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

@Rukomoynikov can you please explain how this improves the code. Is it that it's easier to read or are there performance implications? The = render workshops pattern is used in a bunch of other files, such as app/views/chapter/show.html.haml, app/views/dashboard/dashboard.html.haml and app/views/events/_events.html.haml. I'm not against this change (I think it makes it clearer what partial is being used to render the event cards) but if we are going to update here we should update everywhere else and get rid of the app/views/workshops/_workshop.html.haml partial.


.col-lg-4.pl-lg-5
%h3
Expand Down