Message from discussion
session variable and model code
Received: by 10.151.76.30 with SMTP id d30mr1918559ybl.26.1276534901453;
Mon, 14 Jun 2010 10:01:41 -0700 (PDT)
X-BeenThere: israelrb@googlegroups.com
Received: by 10.150.247.33 with SMTP id u33ls6132413ybh.4.p; Mon, 14 Jun 2010
10:01:41 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.151.18.1 with SMTP id v1mr312805ybi.59.1276534901077; Mon, 14
Jun 2010 10:01:41 -0700 (PDT)
Received: by w31g2000yqb.googlegroups.com with HTTP; Mon, 14 Jun 2010 10:01:41
-0700 (PDT)
Date: Mon, 14 Jun 2010 10:01:41 -0700 (PDT)
In-Reply-To: <AANLkTimaz7zX80agIZ6qBpVyYeLvx_WJuvIymePyyjK1@mail.gmail.com>
X-IP: 85.64.164.51
References: <b77ba786-8f4d-4a7d-8abe-dcf37109a0f7@b35g2000yqi.googlegroups.com>
<51213C5D-32EB-46A5-8D99-D666C55B3A51@gmail.com> <AANLkTimaz7zX80agIZ6qBpVyYeLvx_WJuvIymePyyjK1@mail.gmail.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4
(KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4,gzip(gfe)
Message-ID: <a17c6134-c973-4bce-a728-8d57f28faac3@w31g2000yqb.googlegroups.com>
Subject: Re: session variable and model code
From: labria <lab...@gmail.com>
To: "Israel.rb - the Israel Ruby & Israel Rails Developers group" <israelrb@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Your question reminded me of a joke:
- Did you see the Avatar movie?
- Yeah, the book is better.
- Which book?
- ANY book!
=3D)
On Jun 14, 7:13=A0pm, Michal Yad-Shalom <michal...@gmail.com> wrote:
> which guide?
>
>
>
>
>
> On Mon, Jun 14, 2010 at 7:05 PM, Elad Meidar <eize....@gmail.com> wrote:
> > I would read about model translations, it's in the guide on
> > guides.rubyonrails.org
>
> > Elad Meidar, Nautilus6
> >http://blog.eizesus.com
> >http://twitter.com/eladmeidar
>
> > On Jun 14, 2010, at 18:15, michalyad <michal...@gmail.com> wrote:
>
> > Hi,
> >> My new application is language dependent, according to user's choice.
> >> I set the current language in the application controller and I would
> >> like that certain accessors in my model will transparantly recognize
> >> the current language and will get the relevant content.
>
> >> I have tried to put the current language in a global variable i.e.
> >> $current_language. That is working fine for the model. I.e. my model
> >> code recognizes this variable. however global variable changes the
> >> current on a server level and not on a session level.
>
> >> I have tried session[:language], but the model does not know this
> >> variable.
>
> >> I have tried @current_language, but the model thinks its null.
>
> >> so how can I set a value in the application controller, so that any of
> >> my models will recognize the variable?
>
> >> -- You received this message because you are subscribed to the Google
> >> Groups "Israel.rb - the Israel Ruby & Israel Rails Developers group" g=
roup.
> >> To post to this group, send email to israelrb@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> israelrb+unsubscribe@googlegroups.com<israelrb%2Bunsubscribe@googlegro=
ups.c om>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/israelrb?hl=3Den.
>
> > --
> > You received this message because you are subscribed to the Google Grou=
ps
> > "Israel.rb - the Israel Ruby & Israel Rails Developers group" group.
> > To post to this group, send email to israelrb@googlegroups.com.
> > To unsubscribe from this group, send email to
> > israelrb+unsubscribe@googlegroups.com<israelrb%2Bunsubscribe@googlegrou=
ps.c om>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/israelrb?hl=3Den.
>
> --
> Michal Yad Shalom