Forum: Ruby on Rails setting variable via url

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
82a578052d304559f15180bdf56555d2?d=identicon&s=25 Tarscher (Guest)
on 2007-05-21 17:21
(Received via mailing list)
Hi all,

One of my routes looks like this: map.connect

The :blog should actualy become a session variable (indication who's
blog it is). eg url: I want to set a
session variable to 'railsblog'. Is this possible? If yes, how do I do

Thanks in advance
Db303dc84d03a992b33cd3ac978f89ae?d=identicon&s=25 Benjamin Curtis (Guest)
on 2007-05-21 19:25
(Received via mailing list)
In your example, params[:blog] has the value 'railsblog', so you
could do session[:blog] = params[:blog] to set a session variable
with that value.

Building an e-commerce site with Rails?

Meet up at RailsConf:
82a578052d304559f15180bdf56555d2?d=identicon&s=25 Tarscher (Guest)
on 2007-05-22 10:18
(Received via mailing list)
With every request I should set that blog parameter to the session
variable. I tried to add session[:blog] = params[:blog] in the
ApplicationController but this doesn't work ('We're sorry, but
something went wrong.'). Isn't the AppliationController always called
and isn't it thus the perfect place to set that session variable?

Thanks in advance
This topic is locked and can not be replied to.