SpinaCMS / Spina

Spina CMS
http://www.spinacms.com
Other
2.19k stars 405 forks source link

Can't resolve image into URL: undefined method `to_model' #539

Closed osborng closed 4 years ago

osborng commented 4 years ago

the "image_tag content(:image).variant(resize: "200x100")" code in the demo page view throws the following error when browsing to the page after selecting an image in the admin area. Can't resolve image into URL: undefined method `to_model' for #

Ruby version: 2.7.1 Rails version: 6.0.2.2 Spina version: latest master commit

Image display works properly when adding an image in the text section of the demo page.

Bramjetten commented 4 years ago

Try: image_tag main_app.url_for(content(:image).variant(resize: "200x100"))

osborng commented 4 years ago

That resolved the issue. Thank you.