kylesandhage [1:22 PM] https://github.com/excid3/simple_calendar/blob/master/app/views/simple_calendar/_month_calendar.html.erb
http://code.runnable.com/me/Vv7HadTUQPN72Xly
- click run button to fire it off
- then click the pop out arrow to get the page in its own window http://web-e35ee47f-b815-481e-99c2-776381f87779.runnablecodesnippets.com/events
you should see a calendar with days of the week shown in 2 formats default 2016-04-01 Day of month 1
I started with their vanilla rails project http://code.runnable.com/
-
click rails icon (it will create a new project for you)
-
then I cloned the sample ajax app into another dir
git clone https://github.com/excid3/simple_calendar-ajax-example.git
then changed the run command (gear next to the run button) to
cd ../simple_calendar-ajax-example; rails server -p 80 -b 0.0.0.0
took me a bit to realize that I needed to bind to 0.0.0.0
I thought it was a permissions thing
it works! (but you can't really see it because of a css issue I think)
to make the code viewable in the editor
I made a symlink (from inside the rails_repo dir)
```ln -s /root/simple_calendar-ajax-example calendar_app```
(now that the symlink is there, this would also work for the run command)
```cd calendar_app/; rails server -p 80 -b 0.0.0.0```
once it is running, it doesn't really show in the main window, probably some css issue
but you can pop it out by clicking the pop out arrow
http://web-e35ee47f-b815-481e-99c2-776381f87779.runnablecodesnippets.com/
Ok, now we have a running demo, but it displays the dates in
How can we change that?
this gave me a clue that we just need to play with the date object and add some formatting http://stackoverflow.com/questions/33302539/rails-4-x-simple-calendar-gem-create-new-record-on-click-in-calendar-cell
Which file? (calendar_app is our symlink) from the editor view calender_app/app/views/events/_calendar.html.erb
<%= month_calendar events: events do |date, events| %>
default <%= date %> <br/>
Day of month <%= date.strftime('%e') %>
<% events.each do |event| %>
<div>
<%= event.name %>
</div>
<% end %>
<% end %>
When I came back and tried it again
- the run button was just running rails server -p 80
- instead of
cd ../simple_calendar-ajax-example; rails server -p 80 -b 0.0.0.0
even though that is what was in the run command entry I copied it, deleted it, tabbed away, pasted it back in, and then it worked