[temp]Ajax request of happening now JSON in progress

This commit is contained in:
Jimmy 2021-04-05 15:07:18 +08:00
parent 093241fd0a
commit 9bfe64c28f
2 changed files with 23 additions and 2 deletions

View file

@ -69,6 +69,9 @@ class ConferencesController < ApplicationController
).order('sponsorship_levels.position ASC', 'sponsors.name')
@sponsors = @conference.sponsors
end
if splashpage.include_happening_now
@happening_now_url = happening_now_conference_schedule_path(conference_id: @conference.short_title, format: :json)
end
end
def calendar

View file

@ -46,8 +46,7 @@
-# happening now events
- if @conference.splashpage.include_happening_now
= 'Hello Word'
= 'test'
-# calls for content, or program
- if @conference.splashpage.include_cfp
= render 'call_for_content', conference: @conference,
@ -86,3 +85,22 @@
- if @conference.contact.has_social_media?
= render 'social_media', contact: @conference.contact
= render 'footer'
:javascript
var loadData = function() {
$.ajax({
type: 'GET',
contentType: 'application/json; charset=utf-8',
url: '#{@happening_now_url}',
dataType: 'json',
success: renderTemplate,
failure: function(){
console.log('error');
}
});
};
var renderTemplate = function(data) {
console.log(data);
console.log("template rendered");
}