I’m want to display different image version:
first article: big banner
second: small banner that float to right/left
so, first thing: use cycle() but dont work:
= cycle(image_tag(banner_big), image_tag(banner_small)
or
= image_tag(cycle(banner_big_path, banner_small_path))
Only first image is displayed
There’s a proper way to make one like that ?
Your problem is that rails is expecting you to call cycle with the same set of strings each time. At the moment you’re passing a different pair of strings to each call to cycle, so rails resets the cycle each time. New cycles always start with their first value, hence the result you describe.
Assuming your articles had methods called
small_path,big_path, something likeShould return alternate image paths.