Re: [Radiant] How to add additional routes without touching radiant routes.rb

2007-05-07 Thread Leon Yeh
Thanks Sean! I did not think to do this using  the htaccess or handle 
this in apache.

Sean Cribbs wrote:
> Actually, it sounds like you need URL rewriting, not routing.  Routing 
> is used to map URLs to controllers and actions.  In the .htaccess or 
> Apache config file, I would do something like this:
>
> RewriteRule ^/specialoffer(.*)$ /offers/free_bike$1
>
> Sean
>
> Leon Yeh wrote:
>   
>> Hi Sean,
>>
>> The new routes is not specific to an extension, it is more specific to 
>> the instance of my radiant app.
>> For example: I need to route: /specialoffer url  to /offers/free_bike page.
>>
>> In regular rails app, you can just add this into config/routes.rb. 
>> However for radiant, it basically load it from either 
>> vendor/radiant/config/routes.rb or from gem folder, depends on 
>> RADIANT_ROOT.
>>
>> Is there any way to do this on config/routes.rb ? since it is only 
>> applied to only this radiant app and not to the extension ?  I guess I 
>> can just write an extension that can redirect to specific pages, but it 
>> would be overkill for my app.
>>
>> Thanks!
>>
>> Leon Yeh
>>
>> 

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


Re: [Radiant] How to add additional routes without touching radiant routes.rb

2007-05-06 Thread Leon Yeh
Hi Sean,

The new routes is not specific to an extension, it is more specific to 
the instance of my radiant app.
For example: I need to route: /specialoffer url  to /offers/free_bike page.

In regular rails app, you can just add this into config/routes.rb. 
However for radiant, it basically load it from either 
vendor/radiant/config/routes.rb or from gem folder, depends on 
RADIANT_ROOT.

Is there any way to do this on config/routes.rb ? since it is only 
applied to only this radiant app and not to the extension ?  I guess I 
can just write an extension that can redirect to specific pages, but it 
would be overkill for my app.

Thanks!

Leon Yeh




Sean Cribbs wrote:
> If you're creating an extension, it's easy to do in the
> 'define_routes' block of the generated extensions class.  All of the
> routes from extensions are loaded before the Radiant core routes.
>
> Sean
>
> On 5/6/07, Leon Yeh <[EMAIL PROTECTED]> wrote:
>   
>> Hello,
>>
>> I tried to add a new routes into routes.rb. After reading the file, I
>> found it to load routes.rb from radiant root. Is there any easy way to
>> append or combine my routes to the radiant routes. Something similar to
>> the extension routes handler.
>>
>>
>> Thanks in advance,
>> Leon Yeh
>>
>> ___
>> 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
>   
___
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


[Radiant] How to add additional routes without touching radiant routes.rb

2007-05-05 Thread Leon Yeh
Hello,

I tried to add a new routes into routes.rb. After reading the file, I 
found it to load routes.rb from radiant root. Is there any easy way to 
append or combine my routes to the radiant routes. Something similar to 
the extension routes handler.


Thanks in advance,
Leon Yeh

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


Re: [Radiant] Error when testing extensions

2007-05-05 Thread Leon Yeh
Hi Sean and Andrew,

I have the same problem. I have created an extension on mental and pre  
0.6 release. I try to fix it but can not find the problem. This is only 
happen for me when I run the test on instance mode. I have not try to 
run this on svn  installation. I thought my gem installation might be 
the problem, I tried to uninstall and re-install but I get the same error.

Leon Yeh
New Avenue Systems Inc.




Sean Cribbs wrote:
> Are these new extensions or ones that you started before the official release?
>
> Sean
>
> On 5/5/07, Andrew O'Brien <[EMAIL PROTECTED]> wrote:
>   
>> Hi everyone,
>>
>> I'm trying to develop some extensions and whenever I try to run a test I get:
>>
>> uninitialized constant
>> ActionController::Assertions::ResponseAssertions (NameError)
>>
>> I'm running radiant 0.6 (frozen from the gem).  This happens for
>> everything: unit tests, functional tests, tests run through rake,
>> tests run directly -- you name it.
>>
>> Any ideas?
>>
>> Thanks,
>> Andrew
>> ___
>> 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
>   
___
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] Instance Mode and Extension testing

2007-04-20 Thread Leon Yeh
Thanks Erik,

Now I know someone else has the problem, I will see if I can fix this.


Leon Yeh
New Avenue Systems Inc.
Office: (626)254-1757 x880
[EMAIL PROTECTED]
Imagination Delivered. www.newavenue.net




Erik van Oosten wrote:
> Leon Yeh wrote:
>   
>> Has anyone seen the same problem ? Can you run your own 
>> extension test on instance method ?
>>   
>> 
> Yes, I have seen that problem. This is when I switched to that mode 
> where you copy everything from the gems folder to your instance (I am 
> sorry, I really cannot grok the run-mode names) for extension development.
>
> I should not be too hard to fix the environment files to allow testing 
> in all modes. I am still too inexperieced to try.
>
> Regards,
>  Erik.
>
>
>   
___
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


[Radiant] Instance Mode and Extension testing

2007-04-19 Thread Leon Yeh
Hi,

I have been working on the mental version and starting to develop 
several extensions. I checked out the radiant svn version and use 
svn:externals  to checkout my extensions. Everything looks good until I 
am ready to deploy.

The deployment machine is using gem version (instance mode) Radiant 0.6 
RC2. When I run the rake test on my extension, my extension 
test_helper.rb complained that it can not find radiant test and its test 
helper files. Has anyone seen the same problem ? Can you run your own 
extension test on instance method ?


Thanks in advance
Leon
___
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


[Radiant] Radiant Extension and Testing

2007-03-31 Thread Leon Yeh
Hi,

Finally I got sometime to catch up with the new extension framework, 
after launching my first behavior based Radiant app ( vers 0.5).

Using sample codes that I found on the wikis, I was able to build the 
first extensions and are planning to migrate my behaviour code into the 
new framework. 

Everything is working now, until I started to write the test scripts. I 
found that rake and autotest at RADIANT_ROOT only test the radiant code 
and not extensions. Can anybody tell how to tell rake or autotest to 
look also into the extension folders as well ?

Thanks in advance
Leon Yeh


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


Re: [Radiant] GET params through Radiant page?

2006-11-12 Thread Leon Yeh
Hi Michael,

I experienced the same problem, here how I fixed it. I added below 3 lines 
of code into models/page_context.rb


# 
define_tag 'page:query_string' do | tag|
   tag.globals.page.request.parameters['q'] unless
 tag.globals.page.request.nil?
end


As you can see, currently it returned only parameter q.  I am not 100% 
finished with this, but it should be an easy fixed to get other parameters. 
  Hopefully it gives you some idea.

This radius tag, so it would be global, and you can use it anywhere in the 
page.

Sean, I tried first to put into page parts and use custom behavior to 
extract the parameters object, but for some reason the request object is 
always nil at that level. I decided to modify radius instead and it worked. 
I am not sure why this happened.

Best,
Leon Yeh
New Avenue Systems Inc.
Office: (626)254-1757 x880
[EMAIL PROTECTED]
Imagination Delivered. www.newavenue.net

Michael Roper wrote:
> thanks for the reply sean, i'll have a think about your suggestion...
> 
> On 11/12/06, Sean Cribbs <[EMAIL PROTECTED]> wrote:
>> Michael,
>>
>> You can do it, but you'll need a behavior.  By default, all pages are
>> cached and your page would not be able to respond to the GET
>> parameters.  Another option would be to create child pages of your
>> "Contact" page called "sales", "support", or whatever.  Then only the
>> page that processes the submission of the form would need a behavior,
>> and your contact pages wouldn't need to respond to GET params.
>>
>> Cheers,
>> Sean Cribbs
>> seancribbs.com
>>
>> Michael Roper wrote:
>>> Hi guys,
>>>
>>> It is possible to access GET parameters passed in the url of a Radiant page?
>>>
>>> For example, I'm making a contact page, and instead of making multiple
>>> enquiry forms (sales, support, general, etc), it would be good if i
>>> could pass a url like '/contact/?type=sales' and then programatically
>>> show different form fields depending on the type of enquiry...
>>>
>>> If this is more of a ruby/rails level thing rather than a radiant
>>> thing, can i still do it from my radiant page?
>>>
>>> Cheers,
>>>
>>> Michael
>>> ___
>>> 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
>>
> ___
> 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