Is there a place for feature requesting? Rails uses the "@" prefix for vars in the request scope, why not add a prefix for the session scope? Instead of "session[:myvar]" it could then be something like "%myvar". -- Posted via http://www.ruby-forum.com/.
Hi -- On Wed, 2 Aug 2006, Bart Ender wrote:> Is there a place for feature requesting? > > Rails uses the "@" prefix for vars in the request scope, why not add a > prefix for the session scope? Instead of "session[:myvar]" it could then > be something like "%myvar".That''s not valid Ruby. @var is a Ruby instance variable, which is what Rails uses for controller <=> template communication. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <----- http://dablog.rubypal.com => D[avid ]A[. ]B[lack''s][ Web]log http://www.manning.com/black => book, Ruby for Rails http://www.rubycentral.org => Ruby Central, Inc.
Bart Ender wrote:> Rails uses the "@" prefix for vars in the request scope...It''s not so much that "Rails uses a prefix" in this case. The @ is all Ruby; it indicates the identifier is an object-level variable. This enables Rails to do whatever meta-magic it does to push them down into the view. (If they were without the @, they would go out of scope upon leaving the action. Try it.) session, cookies and params aren''t variables. They''re methods. So of course they don''t have a "prefix." (Granted I believe you can still call @session, but it''s deprecated.) - Daniel -- Posted via http://www.ruby-forum.com/.