Ruby on Rails Sunday, March 6, 2016

On 6 March 2016 at 21:45, Donald Ziesig <donald@ziesig.org> wrote:
> ...
> This is the whole thing (including alerts to let me know when clicks are
> handled):
>
> <script>
> var AUTH_TOKEN = $('meta[name=csrf-token]').attr('content');
> $(document).ready(function()
> {
> $('#calendar').fullCalendar(
> {
> minTime: "08:00:00",
> maxTime: "20:00:00",
> eventRender: function (event, element) {
> element.click(function() {});
> },
> eventClick: function(calEvent, jsEvent, view) {
> alert('Clicked on: ' + calEvent.format());
> },
> dayClick: function(date, jsEvent, view) {
> alert('You Clicked on: ' + date.format());
> // $.post('/lockout/'+date.format())
> $.ajax({
> url: '/lockout/'+date.format(),
> type: 'post',
> dataType: "html",
> data: "&authenticity_token="+AUTH_TOKEN,
> success: function(){alert('SUCCESS');},

You are not doing anything with the response that comes back on
success. That should contain the data you are rendering in the
server.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu9wQ2yQ1X2VaC28tjbJGy2KqZ90Tfb6f%3D2ASUPncxxTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment