[Radiant] Using Rails app within radiant

Sean Cribbs seancribbs at gmail.com
Tue Oct 2 09:14:16 CDT 2007


As long as they are in app/models or lib/ of your extension, they
should be accessible; that is, they will be in the load path.  How you
integrate them into the Radiant application is another story... you
may need to create some controllers and views, or maybe some Radius
tags.  Both of those are briefly covered in the extension tutorial on
the wiki.

Sean

On 10/2/07, jorge santiago <jorge.santiago at gmail.com> wrote:
> I've copied my rails app environment.rb customizations to the radiant
> project's environment.rb and it's now it's loading ok, but still my
> models are not yet accesible from radiant. I'm using
> ActiveRecord::Base.establish_conection in the extension's activate
> method to connect to the rails db, but I don't know how to load my
> rails model definitions. Could you please give me some details on how
> to do it? Sorry if it's something obvius but I'm really lost here.
>
> Thanks a lot for your help,
>
> Jorge
>
> On 10/1/07, Sean Cribbs <seancribbs at gmail.com> wrote:
> > Jorge,
> >
> > You shouldn't require the environment.rb of your Rails app directly.
> > Copy any customizations you have made either into your Radiant
> > project's environment.rb or into the activate method of your
> > extension.  Hopefully that should fix the issue.
> >
> > Sean
> >
> > On 10/1/07, jorge santiago <jorge.santiago at gmail.com> wrote:
> > > Hi Sean,
> > >
> > > I've explored further this approach and it looks exactly what I'm
> > > looking for, but I'm having problems loading the AR models into
> > > Radiant.
> > >
> > > I created the extension and the custom tags, (pretty easy and slick
> > > indeed :), and put the require environment.rb of my rails app at the
> > > top of the 'radiantsite/vendor/extensions/myextension/lib/myextension.rb'
> > > file but I got this errors:
> > >
> > >  warning: already initialized constant OPTIONS
> > > /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:18:
> > > undefined method `options' for []:Array (NoMethodError)
> > >
> > > and the radiant's mongrel server doesn't boot anymore.
> > >
> > > Do I need to require the environment.rb file somewhere else or is
> > > there other method to load my app's models into the radiant.
> > >
> > > Thanks in advance!
> > >
> > > jorge.
> > >
> > > On 9/27/07, Sean Cribbs <seancribbs at gmail.com> wrote:
> > > > You could import some of your models into a Radiant extension and then
> > > > use them there.  They may have to connect to your other database
> > > > manually, i.e. inside their declaration.
> > > >
> > > > Sean
> > > >
> > > > On 9/27/07, jorge santiago <jorge.santiago at gmail.com> wrote:
> > > > > Well, my rails app it's a bit old, so it's not
> > > > > ActiveResource-compatible. It would be great though, to rewrite it and
> > > > > make it RESTful in the future, but currently I don't have the time. Is
> > > > > there another way to achieve what I'm looking for?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Jorge.
> > > > >
> > > > > On 9/27/07, Sean Cribbs <seancribbs at gmail.com> wrote:
> > > > > > Jorge,
> > > > > >
> > > > > > If your app is ActiveResource-compatible, that might be an easy way to
> > > > > > integrate them.
> > > > > >
> > > > > > Sean
> > > > > >
> > > > > > On 9/27/07, jorge santiago <jorge.santiago at gmail.com> wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > I have radiant running my website and would like to use some models
> > > > > > > and functions from another rails app running in the same server. Any
> > > > > > > ideas on how to do this if its possible?
> > > > > > >
> > > > > > > Thanks in advance,
> > > > > > >
> > > > > > > jorge.
> > > > > > > _______________________________________________
> > > > > > > Radiant mailing list
> > > > > > > Post:   Radiant at lists.radiantcms.org
> > > > > > > Search: http://radiantcms.org/mailing-list/search/
> > > > > > > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
> > > > > > >
> > > > > > _______________________________________________
> > > > > > Radiant mailing list
> > > > > > Post:   Radiant at lists.radiantcms.org
> > > > > > Search: http://radiantcms.org/mailing-list/search/
> > > > > > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
> > > > > >
> > > > > _______________________________________________
> > > > > Radiant mailing list
> > > > > Post:   Radiant at lists.radiantcms.org
> > > > > Search: http://radiantcms.org/mailing-list/search/
> > > > > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
> > > > >
> > > > _______________________________________________
> > > > Radiant mailing list
> > > > Post:   Radiant at lists.radiantcms.org
> > > > Search: http://radiantcms.org/mailing-list/search/
> > > > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
> > > >
> > > _______________________________________________
> > > Radiant mailing list
> > > Post:   Radiant at lists.radiantcms.org
> > > Search: http://radiantcms.org/mailing-list/search/
> > > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
> > >
> > _______________________________________________
> > Radiant mailing list
> > Post:   Radiant at lists.radiantcms.org
> > Search: http://radiantcms.org/mailing-list/search/
> > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
> >
> _______________________________________________
> Radiant mailing list
> Post:   Radiant at lists.radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>



More information about the Radiant mailing list