Skip to main content
Ask A Question
You’re not receiving notifications from this thread.

Recurring Events

Rails • Asked by sid d
# Model 
def Event
  WEEKDAYS = ['sunday', 'monday', 'wednesday', 'thursday', 'friday', 'saturday']


# Migration 
create_table :events do |t|
 t.column recurring, default: false 
 t.column start_date:datetime
# Console
Event.create(:name => 'Avengers', :recurring => true, :week_days => ['Sunday', 'Wednesday'])
Event.create(:name => 'Dummy movie', :recurring => false)  #Today events ( Dummy movie, Avengers)
Event.between(tomorrow, end_of_the_month) # ( Avengers, Avengers, Avengers, ...... )  
  • Can anyone suggest best way to implement recurring Events and Fetching of Events according to Weekdays ?

I've found out Recurring Select which best suits my needs. It would be nice if we had a screencast on this

Neat, I didn't know about Recurring Select. What kind of params does the recurring_select field send over? Their Readme doesn't really explain that.

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 29,763+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.