`How to wrap =image_tag into =link_to in Rails?
N
N
nluparev2018-07-17 11:55:10
Ruby on Rails
nluparev, 2018-07-17 11:55:10

How to wrap =image_tag into =link_to in Rails?

there is a user avatar that is generated using

= image_tag sized_image_url(task.user.avatar.url, 32), class: 'avatar-image'

You need to wrap it in = link_to`.
How to make it work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
blackst0ne, 2018-07-17
@nluparev

Use block.

= link_to some_where do 
  image_tag sized_image_url(task.user.avatar.url, 32), class: 'avatar-image'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question