In fact the previous example doesn't change the value of
PeopleHelpers::MYCONSTANT
but if I do :
<%
joke = PeopleHelpers::MYCONSTANT.dup
joke[:opt][:title].sub!('a','b')
#if i debug there, PeopleHelpers::MYCONSTANT = {:opt => {:title =>
bbcdef}}
%>
the value changed.. why ?
On Mar 25, 11:34 am, Adrien Coquio <[email protected]> wrote:
> I have a constant in my helper :
> MYCONSTANT = { :opt => { :title => "abcdef" } }
>
> In my view :
> <%
> joke = PeopleHelpers::MYCONSTANT.dup
> joke[:opt][:title] = nil
> #if i debug there, PeopleHelpers::MYCONSTANT = {:opt => {:title =>
> nil}}
> %>
>
> I can't understand this behaviour and how fix it ?
> Is it a bug ?
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.