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.