ruby on rails - Using cycle method for the class in an image_tag -


I have one of the view files, where I need to cycle cycles for my image tag. Since it is inside an image tag, I would like to have & lt;% = data% & gt; inside and lt;% = image_tag% & gt; to use.

  and lt;% = image_tag (room.image_url, class = "& lt;% = cycle ('room1', 'room2')%>")% & gt;  

I think we can not use it like this. & Lt;% =%> If not in the other side please correct me. I am quite new to the rail.

I found this link here:

In a comment I saw something like this:

   cycle ('room1', 'room2'))%>  

I tried to do this, but only taking room 1 in the form of CDS all the time. Rooms 1 & amp; Room 2

I have been working on this for a long time. I would be happy if someone could help me solve this problem.

Try using it like this:

  cycle ( 'Room1', 'room2', name: 'image')  

Comments