# New Howto; How to use the Dev mode

**URL:** <https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454>\
**Category:** Radiant CMS\
**Created:** [September 29, 2006, 10:05am UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454 "2006-09-29T10:05:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 10:05am UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/1 "2006-09-29T10:05:28Z")

</div>

I created a first (small) draft of this howto on the wiki, you can find  
it  
here: [http://dev.radiantcms.org/radiant/wiki/HowToDevAndProduction](http://dev.radiantcms.org/radiant/wiki/HowToDevAndProduction)

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 11:19am UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/2 "2006-09-29T11:19:37Z")

</div>

I’ve learned this accidentally from the code just a few days ago. It’s  
nice  
someone took time to wikify this, thanks!

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 12:11pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/3 "2006-09-29T12:11:45Z")

</div>

I tried the dev mode out on my Radiant blog the other day but I just  
can’t  
get Radiant to recognise that it’s running under  
[dev.digitalblueprint.co.uk](http://dev.digitalblueprint.co.uk).  
I’ve tried both server aliases and seperate virtual hosts for the  
different  
domains but still no go. Has anyone else had a similar problem that  
they’ve  
managed to fix?

Thanks,  
Kevin A.

Technical Director  
BN23 Search Ltd.

blog: [http://www.digitalblueprint.co.uk](http://www.digitalblueprint.co.uk)

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 12:21pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/4 "2006-09-29T12:21:47Z")

</div>

How’s the alias set up? And how’s your radiant installation set up?

2006/9/29, Kevin A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 12:39pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/5 "2006-09-29T12:39:58Z")

</div>

Well, I currently have it set up as two seperate virtual hosts. One for  
www.mydomain and the other for dev.mydomain, both DocumentRoot’s are  
referencing the same symlink to radiant/public. The server is running  
Apache  
1.3 with fcgi.

The Radiant::Config[“dev.host”] is also definately set to “dev.mydomain”

Any ideas? Maybe it’s the server setup, I’ll have a go at getting an env  
dump from both domains as soon as I get a moment.

Thanks,  
Kev

> **[Digital Marketing Agency Glasgow | Digital Blueprint | Scotland](https://www.digitalblueprint.co.uk)**
>
> Digital Blueprint is a full-service creative design and digital marketing agency that helps visionary companies realise their strengths and elevate their brands, crafting authentic experiences that engage and inspire audiences at every touch point.

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 12:41pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/6 "2006-09-29T12:41:59Z")

</div>

dev.host should be set to “dev” only. Other than that it should work.

2006/9/29, Kevin A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 12:50pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/7 "2006-09-29T12:50:00Z")

</div>

OK, I’ve tried it with both “dev” and “dev.mydomain” with no go. Env  
dumps  
for both domains can be found here if it’s any help:

[http://www.digitalblueprint.co.uk/test](http://www.digitalblueprint.co.uk/test)  
[http://dev.digitalblueprint.co.uk/test](http://dev.digitalblueprint.co.uk/test)

I’ll have a look at the code later and see if i can see why it’s not  
recognising the domains.

Thanks,  
Kev

> **[Digital Marketing Agency Glasgow | Digital Blueprint | Scotland](https://www.digitalblueprint.co.uk)**
>
> Digital Blueprint is a full-service creative design and digital marketing agency that helps visionary companies realise their strengths and elevate their brands, crafting authentic experiences that engage and inspire audiences at every touch point.

On 9/29/06, Giovanni I. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > The Radiant::Config[“dev.host”] is also definately set to “dev.mydomain”  
> > On 9/29/06, Giovanni I. \< removed\_email\_address@domain.invalid\> wrote:
> > 
> > > >
> > 
> > Radiant mailing list  
> > Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

–  
Kevin A.

Technical Director  
BN23 Search Ltd.

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 1:04pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/8 "2006-09-29T13:04:03Z")

</div>

It’s a simple regex on the hostname, are you sure you’re not  
redirecting?

2006/9/29, Kevin A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 2:28pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/9 "2006-09-29T14:28:10Z")

</div>

No, it’s definately not redirecting. Looking at the code, the first  
check it  
performs is whether or not @request.host == Radiant::Config[‘dev.host’]  
so  
the config var should definately be set to the full domain, not just  
“dev”  
as the second check it performs checks for that as the default.

I’ve updated the env\_behavior to show the output from the dev? checks,  
and  
as you can see it’s picking performing them fine (although the logic for  
the  
default check in radiant may be wrong? - the regex returns 0 if it  
detects  
the default ‘dev’ subdomain, otherwise nil)

[http://www.digitalblueprint.co.uk/test](http://www.digitalblueprint.co.uk/test)  
[http://dev.digitalblueprint.co.uk/test](http://dev.digitalblueprint.co.uk/test)

So, even though the dev? check returns true, I still cannot see the  
draft  
articles on my dev domain. I’ll have to do some further investigation I  
think.

Kev

> **[Digital Marketing Agency Glasgow | Digital Blueprint | Scotland](https://www.digitalblueprint.co.uk)**
>
> Digital Blueprint is a full-service creative design and digital marketing agency that helps visionary companies realise their strengths and elevate their brands, crafting authentic experiences that engage and inspire audiences at every touch point.

On 9/29/06, Giovanni I. \< removed\_email\_address@domain.invalid\> wrote:

> > > > dev.mydomain"  
> > > > On 9/29/06, Giovanni I. \< removed\_email\_address@domain.invalid\> wrote:
> > > > 
> > > > > > else had a similar problem that they’ve managed to fix?
> > > > 
> > > > * * *
> > > 
> > > Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)
> 
> 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)

–  
Kevin A.

Technical Director  
BN23 Search Ltd.

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 3:00pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/10 "2006-09-29T15:00:15Z")

</div>

You don’t see them in the main page, have you tried going directly to  
their  
url? Because \<r:children:each\> still doesn’t catch draft pages, even in  
dev  
mode.

2006/9/29, Kevin A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 3:30pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/11 "2006-09-29T15:30:21Z")

</div>

Ah, this could very much explain why i thought it wasn’t working. Maybe  
a  
note could be put up about this on the wiki, I was fully expecting the  
site  
to act exactly as if everything was set to “published” in dev mode.

Thanks,  
Kev

> **[Digital Marketing Agency Glasgow | Digital Blueprint | Scotland](https://www.digitalblueprint.co.uk/)**
>
> Digital Blueprint is a full-service creative design and digital marketing agency that helps visionary companies realise their strengths and elevate their brands, crafting authentic experiences that engage and inspire audiences at every touch point.

On 9/29/06, Giovanni I. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > domain, not just “dev” as the second check it performs checks for that as  
> > So, even though the dev? check returns true, I still cannot see the
> > 
> > > It’s a simple regex on the hostname, are you sure you’re not
> > > 
> > > > I’ll have a look at the code later and see if i can see why it’s not
> > > > 
> > > > > dev.host should be set to “dev” only. Other than that it should
> > > > > 
> > > > > > dev.mydomain"  
> > > > > > On 9/29/06, Giovanni I. \< removed\_email\_address@domain.invalid\> wrote:
> > > > > > 
> > > > > > > > anyone else had a similar problem that they’ve managed to fix?
> > > > > > 
> > > > > > * * *
> > > > > 
> > > > > Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)
> > > 
> > > Post: removed\_email\_address@domain.invalid  
> > > BN23 Search Ltd.  
> > > 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)

–  
Kevin A.

Technical Director  
BN23 Search Ltd.

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 6:51pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/12 "2006-09-29T18:51:15Z")

</div>

I’ll look into it right now and see if I’m able to fix it. Still  
learning my  
way into radiant code 🙂

2006/9/29, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 3:54pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/13 "2006-09-29T15:54:23Z")

</div>

Giovanni I. wrote:

> You don’t see them in the main page, have you tried going directly to their  
> url? Because \<r:children:each\> still doesn’t catch draft pages, even in dev  
> mode.

Perhaps this is an oversight on my part. I’d accept a patch for this if  
it is truly a problem.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Giovanni\_I](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Giovanni\_I](https://www.ruby-forum.com/u/Giovanni_I)\
**Post date:** [September 29, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/new-howto-how-to-use-the-dev-mode/70454/14 "2006-09-29T19:53:25Z")

</div>

John I looked through the sources to see if I could easily fix this  
problem  
and I fear it can’t easily be fixed because \<r:children\> is inside a  
model,  
and the published state for retrieval is hardcoded in there.

On the other hand the subdomain recognization is controller level stuff.  
I  
think this is what someone was referring to when he said that Radiant  
stretches the MVC boundaries.

2006/9/29, Giovanni I. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
