Equivalent of request.setAttribute(key, value) in Rails?

Hi All

I come from Java/J2EE background and I was wondering if there was any
way of
setting an attribute-value in request.

As far as I understand the equivalent is/are the controller instance
variable that are exposed to the view(templates/layout). But they are
the same as storing values in request objects in Java servlets. Plus I
this can give rise to race condition and data swapping between multiple
requests in production environment. Because from what I have read in
production environment there is only one instance of each controller
will serve all requests, hence the instance variables will be re-used
multiple requests. As these instance variables are used to render data
views is it not possible that a race condition arise where a new
changes the same instance variable that they previous request was using
render the view.

Please help me understand and allay my concerns


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs