Save 36% for Black Friday! Learn more

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Upgrading simple_calendar for Rails 5 Discussion

like the new intro

Reply

Re. the talking head. For me, it's an epic distraction from the main content. It's nice to put a human face to the voice, but overlaying the entire video seems wrong to me. Don't know if others feel the same, but I'd suggest just popping up at the start & at moments when body language/gestures actually add to the pedagogical value.

Reply

Hi Chris. I have a question.

If i use this:
= month_calendar events: @dances, previous_link: events_ajax_previous_link, next_link: events_ajax_next_link do |start_date, dances|
= start_date.strftime("%d") if start_date.present?
- dances.each do |dance|
%h6.cal
= link_to dance.style.name, dance_path(dance)

to show an event (in this case a dance event), and it works fine for one event but

HOW do i SHOW a recurring dance event, lets say next 3 recurrences like below but that it shows on each recurrence date on the calendar?

= dance.converted_schedule.next_occurrences(3)
i can show the dates with this code but i want them to show in the calendar.

ALSO is there a way to show multiple type of events from different models all in the same calendar?

thank you!

Reply

For both recurring events and various types, you just have to make them into one array and pass them in. So rather than calling them @dances, you might use @events and create it like so:

@events = Dance.all + Meeting.all

I just recorded a basic episode on recurring events, but you'd just generate them in memory and add them into this @events array. The calendar doesn't need to know anything about recurring events, just needs the individual events to display.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.