# ActiveScaffold and Radiant in same application

**URL:** <https://www.ruby-forum.com/t/activescaffold-and-radiant-in-same-application/112571>\
**Category:** Radiant CMS\
**Created:** [August 21, 2007, 12:13am UTC](https://www.ruby-forum.com/t/activescaffold-and-radiant-in-same-application/112571 "2007-08-21T00:13:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![topherzee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f1d935/32.png) [@topherzee](https://www.ruby-forum.com/u/topherzee)\
**Post date:** [August 21, 2007, 12:13am UTC](https://www.ruby-forum.com/t/activescaffold-and-radiant-in-same-application/112571/1 "2007-08-21T00:13:38Z")

</div>

Hello,  
Im creating a Frankenstein CMS with ActiveScaffold & Radiant.  
The two softwares complement each other very nicely.  
ActiveScaffold handling multiples of items like press releases, products  
etc.  
Radiant handling one-off pages and simple items like blog posts.

My first goal is just to have both running in the same application, so I  
can  
create a simple uberadmin page that will allow users to use one or the  
other  
tool. This appears to be working.

Finally having some success I thought Iwould post it here for anyone  
else  
who might be interested in the same thing. However I am new to  
Rails/Radiant/ActiveScaffold and have not yet considered the security or  
other more advanced implications of this merger.

In the near future I am hoping to add RecordTags extension so that the  
Radiant pages can actually display the information being added to the DB  
by  
ActiveScaffold.  
I also hope to add ActsAsTaggable\_OnSteroids to the ActiveScaffold  
admin.

My implementation follows. I welcome any comments and criticisms!!!

In a nutshell: Used Radiant\_On\_Rails extension so that ActiveScaffold  
controllers could be accessed at all, since be default, Radiant will  
only  
accept urls that map to pages in its own system.

> > > > > > >

Install radiant via GEM.  
o OK

Create Radiant project via Radiant command.  
o OK

Create separate ActiveScaffold project and get it working. Have it use  
the  
same DB as the Radiant project.  
o OK

Add “app” directory from ActiveScaffold project to Radiant project  
Copy plugin directory from ActiveScaffold to Radiant project.  
Copy files from “public” directory from ActiveScaffold to Radiant  
project.  
(like images/javascript/stylesheet files…)  
Visit website.  
o Received 505  
o Dev LOG Shows: uninitialized constant  
ApplicationController::ActiveScaffold

Renamed app/application.rb to app/application\_DISABLED.rb .  
o Works. Problem was that Radiant has its own application.rb in the  
GEM.  
(Is there a better way to handle this, so that both app/application.rb  
files  
get run?)

Visit admin section in web browser:  
o NoMethodError in Admin/page#index  
o Showing admin/page/\_node.rhtml where line #10 raised:  
o undefined method `image’ for #\<#Class:0x4a16860:0x4a16838\>  
o (In cannot find the image method which is defined in:  
RADIANT\_ROOT/app/helpers/application\_helper.rb)

Renamed app/helpers/application\_helper.rb to  
application\_helper\_DISABLED.rb  
.  
o Works (Again, problem was that Radiant has its own  
application\_helper.rb in the GEM. (Is there a better way to handle this,  
so  
that both app/application.rb files get run?)

Install Radiant\_on\_rails Radiant extension. Make changes to routes.rb /  
extensions.rb & copy extension to extension directory.  
o Radiant still works.  
o I am successfully able to configure a “custom” controller in the  
app  
directory and reach it with the web browser. Yes!

Now try to get ActiveScaffold to work.  
Copy code that was at the top of  
ActiveScaffold\_ROOT/app/controllers/application.rb to the top of my  
controller for my model (which is called “category”.)  
Try browsing to localhost/3000/category  
o Radiant returns: “item not found” message.

Make change to routes.rb (specially formatted for Radiant\_On\_Rails.)  
class RailsRoutes  
def self.define\_routes(map)  
map.connect ‘:controller/:action/:id’  
end  
end

o Everything seems to work! Radiant generated website, Radiant Admin,  
ActiveScaffold pages, my Custom pages.  
(Is there something wrong with having such a liberal routing??)

-topher

ps.  
Its been difficult for me. This post helped alot - basically suggesting  
to  
use Radiant\_On\_Rails:  
[http://groups.google.com/group/radiantcms-dev/browse\_thread/thread/c605fe74cd23f175/122957d72f975e91#122957d72f975e91](http://groups.google.com/group/radiantcms-dev/browse_thread/thread/c605fe74cd23f175/122957d72f975e91#122957d72f975e91)

–  
Christopher Z.  
removed\_email\_address@domain.invalid  
604-484-9279

---

<div class="post-metadata">

**Author:** ![topherzee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f1d935/32.png) [@topherzee](https://www.ruby-forum.com/u/topherzee)\
**Post date:** [August 21, 2007, 1:21am UTC](https://www.ruby-forum.com/t/activescaffold-and-radiant-in-same-application/112571/2 "2007-08-21T01:21:42Z")

</div>

Glad you got it working, sounds cool!

What I would suggest to alleviate your conflicts with  
ApplicationController and ApplicationHelper is to extract your  
differences into modules that you can store in an extension and include  
into each of those classes at activation time. This will allow  
Radiant’s built-in stuff to still work, but will also allow you to  
change things that you need to get ActiveScaffold working.

Sean

---

<div class="post-metadata">

**Author:** ![topherzee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f1d935/32.png) [@topherzee](https://www.ruby-forum.com/u/topherzee)\
**Post date:** [August 21, 2007, 5:27pm UTC](https://www.ruby-forum.com/t/activescaffold-and-radiant-in-same-application/112571/3 "2007-08-21T17:27:45Z")

</div>

Christopher Z. wrote:

[…]

> o Everything seems to work! Radiant generated website, Radiant Admin,  
> ActiveScaffold pages, my Custom pages.  
> (Is there something wrong with having such a liberal routing??)

Hallo! I’m currently trying to follow step by step - but do get  
completly different errors … well - which versions of both  
radiant[gem] and active scaffold do you use - on which box? What do you  
mean when you say ‘add’ what when you say ‘copy’ … when do you start  
which environment? It’s not exactly a tutorial here …

Sounds all so promising and I’ll keep trying! Thanx Christopher!

B.

---

<div class="post-metadata">

**Author:** ![topherzee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f1d935/32.png) [@topherzee](https://www.ruby-forum.com/u/topherzee)\
**Post date:** [August 21, 2007, 7:20pm UTC](https://www.ruby-forum.com/t/activescaffold-and-radiant-in-same-application/112571/4 "2007-08-21T19:20:23Z")

</div>

Hi Benedikt,

I probably wont be able to reply in more detail until tomorrow or the  
day  
after, sorry about that.  
But i will then.  
As to versions:

Windows XP running “instant rails”  
Ruby version1.8.6 (i386-mswin32)RubyGems version0.9.2Rails version1.2.3  
Radiant from the latest GEM (not edge) … 0.6.2  
ActiveScaffold - edge - the latest code via SVN.

Basic Principle: I just got two applications working, the radiant  
application and an active scaffold application (which worked off the  
same DB  
as the radiant application). And piece by piece brought the important  
parts  
of the activescaffold app into the radiant app.

Good luck!  
-topher

On 8/21/07, Benedikt E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hallo! I’m currently trying to follow step by step - but do get
> 
> * * *
> 
> Radiant mailing list  
> Post: removed\_email\_address@domain.invalid  
> Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)  
> Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

–  
Christopher Z.  
removed\_email\_address@domain.invalid  
604-484-9279
