Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9006413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:24:18+00:00 2026-06-16T01:24:18+00:00

i have git clone fullcalendar_assets and it’s running smoothly and event showing. my application

  • 0

i have git clone fullcalendar_assets and it’s running smoothly and event showing.

my application rails 3.2.6 using postgresql for dbms. I try to apply fullcalendar in my application. but event not appear.

to the point.

on routes.rb

namespace admin do
 resources :events
end

on admin/events_conttroler.rb

class Admin::EventsController < ApplicationController
  include Tenantable::Schema::Controller

  before_filter :authenticate_admin!

  def index
    @events = Event.scoped
    @events = Event.between(params['start'], params['end']) if (params['start'] && params['end'])

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: ([:admin, @events]) }
    end
  end

on event.rb

class Event < ActiveRecord::Base
  include Tenantable::Schema::Model

  scope :between, lambda {|start_time, end_time|
    {:conditions => [
  "starts_at > ? and starts_at < ?",
  Event.format_date(start_time), Event.format_date(end_time)
] }
  }

  # need to override the json view to return what full_calendar is expecting.
  # http://arshaw.com/fullcalendar/docs/event_data/Event_Object/
  def as_json(options = {})
    {
      :id => self.id,
      :nama => self.nama,
      :keterangan=> self.keterangan || "",
      :start => starts_at.rfc822,
      :end => ends_at.rfc822,
      :allDay => self.all_day,
      :recurring => false,
      :url => Rails.application.routes.url_helpers.adminsekolah_event_path(id),
      #:color => "red"
    }

  end

  def self.format_date(date_time)
    Time.at(date_time.to_i).to_formatted_s(:db)
  end

end

and on events.js.coffee

$(document).ready ->
  $('#calendar').fullCalendar
    editable: true,
    header:
      left: 'prev,next today',
      center: 'title',
      right: 'month,agendaWeek,agendaDay'
    defaultView: 'month',
    height: 500,
    slotMinutes: 30,

    eventSources: [{
      url: '/admin/events',
    }],

    timeFormat: 'h:mm t{ - h:mm t} ',
    dragOpacity: "0.5"

    eventDrop: (event, dayDelta, minuteDelta, allDay, revertFunc) ->
      updateEvent(event);

    eventResize: (event, dayDelta, minuteDelta, revertFunc) ->
      updateEvent(event);


updateEvent = (the_event) ->
  $.update "/events/" + the_event.id,
    event:
      nama: the_event.nama,
      starts_at: "" + the_event.start,
      ends_at: "" + the_event.end,
      keterangan: the_event.keterangan

i try to add one event and event put on database (schema : subdomain / not public), it’s smoothly but i run localhost:3000/admin/events , event does not appear on the calendar (not error)

following command such as

Started GET "/admin/events?start=1353776400&end=1357405200&_=135557072567
2" for 127.0.0.1 at 2012-12-15 18:25:25 +0700
Processing by Admin::EventsController#index as JSON
Parameters: {"start"=>"1353776400", "end"=>"1357405200", "_"=>"1355570725672"}
Admin Load (2.0ms)  SELECT "public"."admins".* FROM "public"."admins" WHERE "public"."admins"."id" = 25 LIMIT 1
Event Load (2.0ms)  SELECT "events".* FROM "events" WHERE (starts_at > '2012-11-25 00:00:00' and starts_at < '2013-01-06 00:00:00')
Completed 200 OK in 10ms (Views: 3.0ms | ActiveRecord: 4.0ms)

i try the query in psql

education_development=# SELECT * FROM subdomain.events WHERE (starts_at > '2012-11-25 00:00:00' and starts_at < '2013-01-06 00:00:00')
education_development-# ;
id |     name      |       starts_at        |        ends_at         | all_day|   description    |         created_at         |         updated_at
----+---------------+------------------------+------------------------+---------+-----------------+----------------------------+----------------------------
1 | New Year 2013 | 2013-01-01 00:00:00+07 | 2013-01-01 00:00:00+07 | f | New Year 2013 | 2012-12-15 06:53:50.695456 | 2012-12-15 06:53:50.695456
(1 row)

any idea for this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:24:19+00:00Added an answer on June 16, 2026 at 1:24 am

    Apparently this is because the JSON returned from the controller, it should return an array of events but instead it returns an array of ‘admin’ as the first element and array of events as the second element, which fullcalendar doesn’t expect. Simply use

          format.json { render json: @events }
    

    and it should work.

    UPDATE: Also you localized the hash keys of the JSON representation of your event object, you must use the the same keys in fullcalendar model/event.rb.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have cloned a directory using git clone commnad and following are the commands
I have downloaded the Linphone-android source code using git clone. When I imported the
I have a git clone/repo on a development server, but I am now moving
I have a remote git repository and I have cloned one branch git clone
I would like to clone a git project (from github, say), and have the
I have GIT running on a Solaris server. From a windows machine I installed
I have a git checkout of an svn repository created via git svn clone.
i have create clone of project on local machine with git clone git@github.com:test/abc.git Now
I'd like to git clone the contents of a repository I have on GitHub
I have a git svn repository. git svn clone http://myrepo/ myrepo I dont want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.