I'm creating an event application in Rails 4 and am wondering how I would approach a solution to the following problem. I have events and I want to display them on a date page.
For example if I have two events on August 24th I would like to show both of those events on a the August 24 page (/events/08/24/2015). I'm not sure how to generate pages for the current and next year in rails and how to properly setup the routing.
Can someone help me with a solution and/or a good place to start? Not quite sure how to approach this problem. Want to do something similar to this: http://omahype.com/2015/08/24
Related
I am working on an app where the user can log his working hours after he finished his shift. The app is developed in Ruby on Rails 4.I used the scaffold method, so it generated the necessary methods for create, read, update, delete. The fields are hours_worked:number overtime:boolean and date:datetime, for now, I plan to expand it later with more functionality, with user login and some other stuf. The model is empty, I did used the rake db:migrate method. Now I know that you can use the count method, as is shown on the official site for active record. I don't have the idea how to get the total number of hours worked and show it on the index page. Consider that I just started learning Rails. Any suggestions?
Sounds like this is best used with the Timers gem.
https://github.com/celluloid/timers
In your Sessions#new method, you'd want to initialize a variable to keep track of the current time. And then every so often, you'd use one of the methods in the gem to update the current time. You could then subtract the difference.
This is hard to answer without any info on how you are actually logging the info, or seeing any of your code. However if you are just looking for general suggestions you could just save start and stop timestamps and compare them. Or ask the user to input time worked. There are probably a thousand different ways to do this. Please be more specific on what exactly you need help with.
I'm using Ruby on Rails, fullcalendar-rails and momentjs-rails.
I'm initializing FullCalendar with a single event for demonstration purposes, as shown here. The start date is specified as 2015-02-01. When viewing the month view for January, the event appears on 2015-01-31. When viewing the month view for February, it appears on 2015-02-01 as well. If I specify a date that isn't the first of a month, it only appears on the previous day.
I tried making a jsfiddle to demonstrate what's happening, but using the exact same code, the event appeared on the correct date.
I'm completely at my wits end with this one. I suspect that this is something to do with timezones, but I've tried manually specifying timezones, specifying UTC, telling FullCalendar to ignore timezones entirely, but nothing has helped. I'm not sure at this point if it's a problem with my Rails server (I don't think so, because the server knows the correct date, time and timezone), the fullcalendar-rails or momentjs-rails gems (doubtful, because I haven't been able to find anybody else having the same issue), my computer (doubtful, because the same code works fine in a jsfiddle), or something else I haven't even considered. Any help or advice to point me in the right direction would be greatly appreciated!
I had the same issue because i'm using rails 4, what I just use this '2.1.1.0 ' version instead.
The dojox.widget.Calendar lets us scroll over the years easily. Can that be simulated/added to the DateTextBox widget?
I prefer the DateTextBox because of the validations and constraints it provides. Also, once opened, the Calendar widget (as in the livedocs site) cannot be closed till a date is selected. Whereas, the popup calendar in the DateTextBox does not have this problem.
The need is this: for a Date of Birth field, we cannot assume one random default year as, let's say, the potential users might be born any time between 1960 to 2000. So, the user might have to do multiple clicks (the older he is, the more number of clicks?!!). How can this usability problem be addressed? The Calendar widget helps in easy navigation. But the DateTextBox shows only 3 years at a time.
Can this be done with any CSS change? Any possible mix and match of components?
I am using v1.7.1
Thanks!
I have the same need. There is an open ticket (10002) but nothing has been done for years. I will try to get an answer on the mailing list.
How can I put event with regarding holidays. Do any one have experience with this??
I need to create event which may have holiday at the middle of that and event should not be visible in that holiday period.
Can any one know how to do this ??
event_calendar plug in link at git hub
I think you need to add holidays in to calendar. There is way to add holidays in to rails event calendar plug in as new event but there is problem arise when holidays comes to middle of the particular event.
I am looking for a gem or plugin for my rails application. I want the user to be able to make an appointment for a certain day. However, the calendar that will show up should have some days excluded. Excluded days mean that there are no appointments on that day.
I came across calendar helper but I don't think it allows for exclusion of certain days.
Has someone come across a plugin like this? It would be better if user was allowed to make appointments not just by day but also by hours in the days. For example 9:30 on 3/14/2011.
I was looking for something similar lately and here is what I found event-calendar-rails-plugin. Not tested though, because I was looking for something that could handle more complex situations, and ended up rolling my own solution.