Here's what I did:

gem install --include-dependencies radiant
radiant myapp
cd myapp
[change database.yml]
rake db:bootstrap
rake radiant:freeze:edge
rake radiant:update
rake db:migrate
[create extension...]

Now you'll have a full copy of radiant's source code in your vendor/ 
radiant directory.  Now go to

vendor/radiant/app/controllers

You'll see site_controller.rb (which I mistakenly referred to as  
SiteController.rb below) - comment out line 2, and sessions will now  
be enabled for the whole app.  If you've previously started your web  
server, you may have to restart for the changes to take effect.

There are much more elegant solutions, I'm sure, but this one worked  
for me.  If you have a problem with edge radiant this might not work.   
If that happens, let me know.

On Nov 16, 2007, at 10:31 PM, Maged Makled wrote:

> Jeff Dean wrote:
>> I believe that this is because of a bug in rails, and not radiant.
>> The SiteController has session :off, and adding session :on in your
>> controllers doesn't seem to do anything.
>>
>> The only way I know to change this is to actually go into
>> SiteController and comment out that line.  I've seen posts about
>> putting things like:
>>
>> SiteController.class_eval{session :on}
>>
>> in the activate method of your extension, but that didn't work for  
>> me.
>>
>> To get it to work, I did froze to edge radiant, then went into
>> SiteController.rb and commented out the session line.  This would  
>> mean
>> that any pages that you want sessions off for you'd have to do
>> manually - so use with caution.
>>
>> Jeff
>
> Thanks for your help. Could you explain your last paragraph in more
> details, I'm totally new to Radiant. where can I find the
> SiteController.rb? any examples would be very helpful
>
> My extension rails_support_extension.rb looks like this
>
> **
> require_dependency 'application'
>
> class RailsSupportExtension < Radiant::Extension
>  version "1.0"
>  description "Allows you to render Rails views in Radiant Layouts. "
>  url "http://code.google.com/p/radiant-rails-support/";
>
>  def activate
>  end
>
>  def deactivate
>  end
>
>  SiteController.send :include, SiteControllerExtension
>  SiteController.helper SiteHelperExtension
>
> end
> **
>
> Thanks in advance
> Maged Makled
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@lists.radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to