On 03/06/2016 05:22 PM, Colin Law wrote:
> 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
>
It always pays to have experts look at your code!
Changing:
success: function(){alert('SUCCESS');}
to:
success: function(){window.location.reload(true);}
made the difference. It works now.
Thank you Colin,
Don
--
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/56DCC460.5070102%40ziesig.org.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment