I'm glad you're enjoying Limelight. It's pretty simple to use
ActiveRecord or ActiveResource in a Limelight production. I can't
think of any open source example off the top of my head but all you
have to do is this:
1. Add the activerecord or activeresource gem to your production. The
easiest way to do this is to use the limelight freeze command ($ jruby
-S limelight freeze activerecord).
2. In the production_loaded method of production.rb: require
'activerecord'.
3. Create a lib directory in the root of the production. This is
where we put all our business logic, which includes models.
4. Add the lib directory to the search path in
Production.production_opening (production.rb).
Now you can use these models from anywhere inside your production. http://groups.google.com/group/limelight_users
Micah
P.S. Please switch over to the google group list.
On Nov 5, 2009, at 8:19 PM, doug livesey wrote:
> Hi -- just started playing with Limelight today, and I must be
> impressed, as it's now 2:15am, here!
> Could someone offer any advice (or links to examples, or tuts) on
> using models in Limelight?
> I was thinking a good test app to get me going would be a browser/
> editor of some of the models in one of my existing RoR apps, so I
> would want to use ActiveRecord or ActiveResource models.
> Is there a standard, recommended way to get these into a Limelight
> app?
> Would a player load them for a prop?
> How would I make that dynamic?
> & thanks for Limelight -- I'm loving it so far!
> Cheers,
> Doug.
> _______________________________________________
> limelight-users mailing list
> limelig...@rubyforge.org
> http://rubyforge.org/mailman/listinfo/limelight-users
Hi Doug,
I'm glad you're enjoying Limelight. It's pretty simple to use ActiveRecord or ActiveResource in a Limelight production. I can't think of any open source example off the top of my head but all you have to do is this:
1. Add the activerecord or activeresource gem to your production. The easiest way to do this is to use the limelight freeze command ($ jruby -S limelight freeze activerecord).
2. In the production_loaded method of production.rb: require 'activerecord'.
3. Create a lib directory in the root of the production. This is where we put all our business logic, which includes models.
4. Add the lib directory to the search path in Production.production_opening (production.rb).
Now you can use these models from anywhere inside your production. http://groups.google.com/group/limelight_users
Micah
P.S. Please switch over to the google group list.
On Nov 5, 2009, at 8:19 PM, doug livesey wrote:
Hi -- just started playing with Limelight today, and I must be impressed, as it's now 2:15am, here!
Could someone offer any advice (or links to examples, or tuts) on using models in Limelight?
I was thinking a good test app to get me going would be a browser/editor of some of the models in one of my existing RoR apps, so I would want to use ActiveRecord or ActiveResource models.
Is there a standard, recommended way to get these into a Limelight app?
Would a player load them for a prop?
How would I make that dynamic?
& thanks for Limelight -- I'm loving it so far!
Cheers,
Doug.