On Feb 7, 2:19 pm, Kelly Pfaff <[email protected]> wrote:
> I have an instance variable @grp:
> (app\controllers\zwemmers_controller.rb)
> class ZwemmersController < ApplicationController
> ...
>   def initialize
>     @grp='or1r2r3r4gggrp'
>   end

In general I'd be wary of overriding initialize without calling super
(i think you're ok here though)

>   attr_accessor :grp
> ...
> end
>
> When i click an image, i reload the main index page and try to change
> the value of the variable:
> (app\views\layouts\zwemmers.html.erb)
>
> ...
> <%= link_to image_tag("oranje.png", :mouseover =>
> image_path("oranje2.png"), :grp => 'o'), zwemmers_path %>
> ...
>
> The value doesn't change. any ideas?

You haven't shown anywhere where you're trying to set it - if you want
it to be set based on a parameter, you're going to have to set @grp to
params[:something]

Fred

>
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
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.

Reply via email to