Hi Campers, i just download and install the last version from http://github.com/why/camping/tree/master Then, when i test with this piece of code : require ''camping'' Camping.goes :Test module Test::Controllers class Index < R ''/'' def get @hello = "Hello World!" render :index end end end module Test::Views def layout html do body do self << yield end end end def index p "Camping say #{@hello}" end end I just see "Camping say" not "Camping say Hello World!"... So what''s wrong ?
You want def get render :index, :hello => "Hello World!" end in your view. Unlike Rails, instance variables aren''t magically carried along from Controller to View. -- Eric On Wed, Nov 12, 2008 at 12:03 PM, Gregoire LEJEUNE <gregoire.lejeune at gmail.com> wrote:> Hi Campers, > > i just download and install the last version from > http://github.com/why/camping/tree/master > > Then, when i test with this piece of code : > > require ''camping'' > > Camping.goes :Test > > module Test::Controllers > class Index < R ''/'' > def get > @hello = "Hello World!" > render :index > end > end > end > > module Test::Views > def layout > html do > body do > self << yield > end > end > end > > def index > p "Camping say #{@hello}" > end > end > > I just see "Camping say" not "Camping say Hello World!"... > > So what''s wrong ? > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Huh? I just pasted that code, ran "camping test.rb" and it worked just like expected: "Camping say Hello World!"... -- Magnus Holm On Wed, Nov 12, 2008 at 6:29 PM, Eric Mill <kprojection at gmail.com> wrote:> You want > > def get > render :index, :hello => "Hello World!" > end > > in your view. Unlike Rails, instance variables aren''t magically > carried along from Controller to View. > > -- Eric > > On Wed, Nov 12, 2008 at 12:03 PM, Gregoire LEJEUNE > <gregoire.lejeune at gmail.com> wrote: > > Hi Campers, > > > > i just download and install the last version from > > http://github.com/why/camping/tree/master > > > > Then, when i test with this piece of code : > > > > require ''camping'' > > > > Camping.goes :Test > > > > module Test::Controllers > > class Index < R ''/'' > > def get > > @hello = "Hello World!" > > render :index > > end > > end > > end > > > > module Test::Views > > def layout > > html do > > body do > > self << yield > > end > > end > > end > > > > def index > > p "Camping say #{@hello}" > > end > > end > > > > I just see "Camping say" not "Camping say Hello World!"... > > > > So what''s wrong ? > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20081112/4e3dceeb/attachment.html>
Hey....me too. I''ve been using the style I recommended before in my code thus far, but maybe I didn''t need to. Is it something that differs between Camping versions? On Wed, Nov 12, 2008 at 12:37 PM, Magnus Holm <judofyr at gmail.com> wrote:> Huh? I just pasted that code, ran "camping test.rb" and it worked just like > expected: "Camping say Hello World!"... > -- > Magnus Holm > > > On Wed, Nov 12, 2008 at 6:29 PM, Eric Mill <kprojection at gmail.com> wrote: >> >> You want >> >> def get >> render :index, :hello => "Hello World!" >> end >> >> in your view. Unlike Rails, instance variables aren''t magically >> carried along from Controller to View. >> >> -- Eric >> >> On Wed, Nov 12, 2008 at 12:03 PM, Gregoire LEJEUNE >> <gregoire.lejeune at gmail.com> wrote: >> > Hi Campers, >> > >> > i just download and install the last version from >> > http://github.com/why/camping/tree/master >> > >> > Then, when i test with this piece of code : >> > >> > require ''camping'' >> > >> > Camping.goes :Test >> > >> > module Test::Controllers >> > class Index < R ''/'' >> > def get >> > @hello = "Hello World!" >> > render :index >> > end >> > end >> > end >> > >> > module Test::Views >> > def layout >> > html do >> > body do >> > self << yield >> > end >> > end >> > end >> > >> > def index >> > p "Camping say #{@hello}" >> > end >> > end >> > >> > I just see "Camping say" not "Camping say Hello World!"... >> > >> > So what''s wrong ? >> > _______________________________________________ >> > Camping-list mailing list >> > Camping-list at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/camping-list >> > >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Maybe _why''s version is broken. Gregoire, could you try using Magnus (judofyr)''s version instead? On 13/11/2008, at 4:42 AM, Eric Mill wrote:> Hey....me too. I''ve been using the style I recommended before in my > code thus far, but maybe I didn''t need to. Is it something that > differs between Camping versions? > > On Wed, Nov 12, 2008 at 12:37 PM, Magnus Holm <judofyr at gmail.com> > wrote: >> Huh? I just pasted that code, ran "camping test.rb" and it worked >> just like >> expected: "Camping say Hello World!"... >> -- >> Magnus Holm >> >> >> On Wed, Nov 12, 2008 at 6:29 PM, Eric Mill <kprojection at gmail.com> >> wrote: >>> >>> You want >>> >>> def get >>> render :index, :hello => "Hello World!" >>> end >>> >>> in your view. Unlike Rails, instance variables aren''t magically >>> carried along from Controller to View. >>> >>> -- Eric >>> >>> On Wed, Nov 12, 2008 at 12:03 PM, Gregoire LEJEUNE >>> <gregoire.lejeune at gmail.com> wrote: >>>> Hi Campers, >>>> >>>> i just download and install the last version from >>>> http://github.com/why/camping/tree/master >>>> >>>> Then, when i test with this piece of code : >>>> >>>> require ''camping'' >>>> >>>> Camping.goes :Test >>>> >>>> module Test::Controllers >>>> class Index < R ''/'' >>>> def get >>>> @hello = "Hello World!" >>>> render :index >>>> end >>>> end >>>> end >>>> >>>> module Test::Views >>>> def layout >>>> html do >>>> body do >>>> self << yield >>>> end >>>> end >>>> end >>>> >>>> def index >>>> p "Camping say #{@hello}" >>>> end >>>> end >>>> >>>> I just see "Camping say" not "Camping say Hello World!"... >>>> >>>> So what''s wrong ? >>>> _______________________________________________ >>>> Camping-list mailing list >>>> Camping-list at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/camping-list >>>> >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >> >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
Hi campers, first, thanks a lot for your answers. I found the problem. This was due to markaby, installed from http://github.com/zimbatm/markaby/tree/master. I have replaced this module with last official version from rubygems then it works. Thanks again. Greg 2008/11/12 Bluebie, Jenna <blueberry at creativepony.com>:> Maybe _why''s version is broken. Gregoire, could you try using Magnus > (judofyr)''s version instead? > On 13/11/2008, at 4:42 AM, Eric Mill wrote: > >> Hey....me too. I''ve been using the style I recommended before in my >> code thus far, but maybe I didn''t need to. Is it something that >> differs between Camping versions? >> >> On Wed, Nov 12, 2008 at 12:37 PM, Magnus Holm <judofyr at gmail.com> wrote: >>> >>> Huh? I just pasted that code, ran "camping test.rb" and it worked just >>> like >>> expected: "Camping say Hello World!"... >>> -- >>> Magnus Holm >>> >>> >>> On Wed, Nov 12, 2008 at 6:29 PM, Eric Mill <kprojection at gmail.com> wrote: >>>> >>>> You want >>>> >>>> def get >>>> render :index, :hello => "Hello World!" >>>> end >>>> >>>> in your view. Unlike Rails, instance variables aren''t magically >>>> carried along from Controller to View. >>>> >>>> -- Eric >>>> >>>> On Wed, Nov 12, 2008 at 12:03 PM, Gregoire LEJEUNE >>>> <gregoire.lejeune at gmail.com> wrote: >>>>> >>>>> Hi Campers, >>>>> >>>>> i just download and install the last version from >>>>> http://github.com/why/camping/tree/master >>>>> >>>>> Then, when i test with this piece of code : >>>>> >>>>> require ''camping'' >>>>> >>>>> Camping.goes :Test >>>>> >>>>> module Test::Controllers >>>>> class Index < R ''/'' >>>>> def get >>>>> @hello = "Hello World!" >>>>> render :index >>>>> end >>>>> end >>>>> end >>>>> >>>>> module Test::Views >>>>> def layout >>>>> html do >>>>> body do >>>>> self << yield >>>>> end >>>>> end >>>>> end >>>>> >>>>> def index >>>>> p "Camping say #{@hello}" >>>>> end >>>>> end >>>>> >>>>> I just see "Camping say" not "Camping say Hello World!"... >>>>> >>>>> So what''s wrong ? >>>>> _______________________________________________ >>>>> Camping-list mailing list >>>>> Camping-list at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/camping-list >>>>> >>>> _______________________________________________ >>>> Camping-list mailing list >>>> Camping-list at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/camping-list >>> >>> >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
On Nov 12, 2008, at 6:29 PM, Eric Mill wrote:> def get > render :index, :hello => "Hello World!" > end > > in your view. Unlike Rails, instance variables aren''t magically > carried along from Controller to View.since when?
Oh, geez, I glanced at an app where I overwrote render to work with Haml instead of Markaby. Sorry for the confusion. On Nov 13, 2008 7:39 AM, "julik" <julian.tarkhanov at gmail.com> wrote: On Nov 12, 2008, at 6:29 PM, Eric Mill wrote: > def get > render :index, :hello => "Hello World!"... since when? _______________________________________________ Camping-list mailing list Camping-list at rubyforge.or... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20081113/9fb458ef/attachment.html>