Forum: Ruby on Rails Calendar Rails 4

E498dab841a6de84c5042fd5cf31f2ce?d=identicon&s=25 Rodrigo Sanguanini (Guest)
on 2014-06-24 15:35
(Received via mailing list)
Hello.
I want to build a week calendar (with options to toggle bewteen month
and
day visions) in a Rails 4 app.
I know that I can use a JS calendar, like FullCalendar, but, I dont know
how to do this and if this will overload the client-side when i get a
lot
of events.
I tried to search about it, but I cant find nothing.
I used data_builder and did the month vision, but I want do this to a
week
vision too.
Can someone give me a hint or show me how to do this?

http://stackoverflow.com/questions/24376397/how-to...
5251fb12ad96bacd1f57e579b28b30fe?d=identicon&s=25 unknown (Guest)
on 2014-06-25 13:33
(Received via mailing list)
look at this that just got
released: https://gorails.com/blog/simplecalendar-1-1-released
E498dab841a6de84c5042fd5cf31f2ce?d=identicon&s=25 Rodrigo Sanguanini (Guest)
on 2014-06-25 14:25
(Received via mailing list)
Okay, and how can I transform this
<https://lh5.googleusercontent.com/-8HNPRYn1Xtk/U6q...



Into this

<https://lh4.googleusercontent.com/-7OsL2LCHazc/U6q...











The above image is a example that what I want to do.


Another thing is that when I use the SimpleCalendar and try to render
the
events, i get this error:

undefined local variable or method `start_time' for #<Event:0x49278d8>


 <https://lh3.googleusercontent.com/--DQ3KWu8D8o/U6q...







Event.rb (model)

class Event < ActiveRecord::Base
  extend SimpleCalendar
    has_calendar attribute: :start_time

end
5251fb12ad96bacd1f57e579b28b30fe?d=identicon&s=25 André Orvalho (Guest)
on 2014-06-25 14:36
(Received via mailing list)
There is an option called month_calendar that should give you that, but
you
can also look at the example that is on the documentation
https://github.com/excid3/simple_calendar-ajax-example

Do you have a field in your database called start_time?

If this does not fill your requirements, you can also follow the
railscasts
on the comments on your stackoverflow post.
E498dab841a6de84c5042fd5cf31f2ce?d=identicon&s=25 Rodrigo Sanguanini (Guest)
on 2014-06-25 15:00
(Received via mailing list)
André, I have watched the revised episode of the calendar railscast but
the
episode cover only a month calendar, not a full day calendar (by hour).
And, i dont have a field called start_time in my db.
I will take a look in that ajax example, thank you.

Quarta-feira, 25 de Junho de 2014 9:36:06 UTC-3, André Orvalho escreveu:
5251fb12ad96bacd1f57e579b28b30fe?d=identicon&s=25 André Orvalho (Guest)
on 2014-06-25 15:13
(Received via mailing list)
This is my own calendar helper:
https://gist.github.com/andreorvalho/fdb28af8284b13fc9829

I have build it from the rails casts. if you look at my weeks method
there,
you can probably do the same for a day. create an array of hours and use
them to render what you want.

Hope it helps.
E498dab841a6de84c5042fd5cf31f2ce?d=identicon&s=25 Rodrigo Sanguanini (Guest)
on 2014-06-25 15:26
(Received via mailing list)
Thank you.
I think that the simple_calendar can do this for me. I just need to
learn
how to render the hours inside the week, and how to render the events
inside the hours.
I will take a look at your calendar helper, too.
Thank you again.


Quarta-feira, 25 de Junho de 2014 10:13:13 UTC-3, André Orvalho
escreveu:
5251fb12ad96bacd1f57e579b28b30fe?d=identicon&s=25 André Orvalho (Guest)
on 2014-06-25 15:32
(Received via mailing list)
You can always accept my answer at stackoverflow :)
E498dab841a6de84c5042fd5cf31f2ce?d=identicon&s=25 Rodrigo Sanguanini (Guest)
on 2014-06-26 13:24
(Received via mailing list)
>
> Hi. Chris Oliver, the Simple_Calendar author, made this yesterday:

https://github.com/excid3/simple_calendar-full-day-example

Screenshot:
http://cl.ly/WGs6
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.