#8 new
Jimmy Schementi

ActiveRecord/Resource in Silverlight

Reported by Jimmy Schementi | April 29th, 2008 @ 06:40 PM | in 0.3

Given this controller code:

client :index

def index

@people = Person.find(:all)

end

"index" will run on the client. However, what should Person.find do? It needs to somehow get to the database and get the data back on the client exactly how it was if it ran on the on server ... so:

1. Person.find should make a syncronous[1] web request back to the client for something like "http://#{http_host}/client_proxy/persons/"

2. The server will respond with the result of Person.find(:all).to_json

3. Person.find will return deserialize json converted into a Person array.

So, how to accomplish this?

  • A model must have "acts_as_client" called at the class level: this will make the model accessible from /client_proxy//
  • Any "acts_as_client" model will be sent to the client
  • ActiveRecord on the client is really a wrapper for ActiveResource (???)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Silverlight and Rails integration with IronRuby

People watching this ticket

Tags

Pages