Created
May 18, 2013 06:48
-
-
Save siguremon/5603511 to your computer and use it in GitHub Desktop.
Ruby on Railsとfllcalendar pluginでGoogleカレンダークローンを作る(3) ref: http://qiita.com/items/fe8546579144f3a51937
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bundle install --path/vendor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var calendar = $("#calendar").fullCalendar({ | |
| events: "/events.json", | |
| selectable: true, | |
| selectHelper: true, | |
| ignoreTimezone: false, | |
| editable: true, | |
| select: select, | |
| eventClick: updateEvent, | |
| eventResize: updateEvent, | |
| eventDrop: updateEvent | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var updateEvent = function(event, revertFunc) { | |
| var title = window.prompt("Edit title", event.title); | |
| var url = "/events/" + event.id; | |
| var data = {_method: 'PUT', | |
| event: {title: title, | |
| start: event.start, | |
| end: event.end, | |
| allDay: event.allDay}}; | |
| $.ajax({ | |
| type: "POST", | |
| url: url, | |
| data: data, | |
| success: function() { | |
| calendar.fullCalendar("refetchEvents"); | |
| }, | |
| error: revertFunc | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment