I don’t know if this is a ruby only question or a rails question. I
have a helper class that updates the view based on the info from the
div tag. This information is passed using the link_to_function. But it
doesn’t work. I don’t know how to access the page elements. Also, is
the if statement syntax correct for ruby? Thank you in advance for any
help.
Is it if x1 == ‘x1’ or is it if x1 = ‘x1’?
module VideosHelper
def hide_and_reset(div, div2)
update_page do |page|
if page[div].title == ‘show’
page[div].hide
page[div].title = ‘hide’
else
page[div].show
page[div].title = ‘show’
end
end
end