dhtmlxScheduler Ruby on Rails 3 Integration

Hi,

I have been trying to get dhtmlxScheduler (latest downloadable version) to work on a Rails 3 project but not having much success.

I have found the sample project and have implemented the modifications for Rails 3. But still can not load data from the database through the controller.

routes.rb

resources :events do
collection do
get ‘view’
get ‘data’
get ‘dbaction’
end
end

events_controller.rb

def view
end

def data
@events = Event.all
end

def dbaction
#called for all db actions
details = params[“details”]
end_date = params[“end_date”]
event_length = params[“event_length”]
event_pid = params[“event_pid”]
rec_type = params[“rec_type”]
start_date = params[“start_date”]
title = params[“text”]

@mode = params["!nativeeditor_status"]
@id = params["id"]
@tid = @id

case @mode
  when "inserted"
    event = Event.new
    event.details = details
    event.end_end = end_date
    event.event_length = event_length
    event.event_pid = event_pid
    event.rec_type = rec_type
    event.start_date = start_date
    event.title = title

    event.save!
    @tid = event.id
    
  when "deleted"
    event=Event.find(@id)
    event.destroy
    
  when "updated"
    event=Event.find(@id)
    event.details = details
    event.end_end = end_date
    event.event_length = event_length
    event.event_pid = event_pid
    event.rec_type = rec_type
    event.start_date = start_date
    event.title = title
    event.save!
end

end

in the view folder:

i have created the following files in the events views folder
data.xml.builder
dbaction.xml.builder
view.html.erb

Problem:
When rendering the view.html.erb, it is raising an alert showing the source code of the the view that is being rendered.

Any idea why?

Thanks for any help in advance.

Hello,

Please check following sample:
support.dhtmlx.com/x-files/sampl … eduler.zip

It uses a bit outdated rails but maybe will give some tips how to implement it.

Kind regards,
Ilya

Thanks Ilya.

I managed to get this working.

Hello logistical,

could you please share how you solved this in your Rails3 app.

I’m hung up on the xml part I think.

I keep getting this error when browsing the show action of my events controller:

Error type: LoadXML
Description: Incorrect XML

any ideas/help would be much appreciated!

How to integrate users and teams to the existing events using RoR?
any ideas?

pls help me to integrate dhtmlxGantt in ror application

pls help me to find a tutorial to integrate ganntt chart in ruby on rails application

Hi rrageshpillai,
do you mean dhtmlxScheduler - dhtmlx.com/docs/products/dhtmlxGantt/ ?

ya this one
dhtmlx.com/docs/products/dhtmlxGantt/