Re: [limelight-users] Using models (ActiveRecord or anything else) in limelight

4 views
Skip to first unread message

Micah Martin

unread,
Nov 6, 2009, 10:25:23 AM11/6/09
to Limelight Users, limelig...@googlegroups.com
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.
> _______________________________________________
> limelight-users mailing list
> limelig...@rubyforge.org
> http://rubyforge.org/mailman/listinfo/limelight-users

doug livesey

unread,
Nov 6, 2009, 10:31:10 AM11/6/09
to limelig...@googlegroups.com
Fantastic, thanks for that overview -- I'll get playing! :)
(& I'll post any further posts to the google group -- cheers!)
   Doug.

2009/11/6 Micah Martin <mi...@8thlight.com>

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.

Paul Pagel

unread,
Nov 6, 2009, 11:08:17 AM11/6/09
to limelig...@googlegroups.com
If you go to:

http://github.com/paulwpagel/fresnel

It is an example of using active resource with limelight

Paul
Reply all
Reply to author
Forward
0 new messages