ActiveScaffold and Radiant in same application

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


Christopher Z.
[email protected]
604-484-9279

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

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.

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. [email protected] wrote:

Hallo! I’m currently trying to follow step by step - but do get


Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant


Christopher Z.
[email protected]
604-484-9279

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs