Problems with link to eval()in RoR
What am I doing wrong here?
This seems to work fine earlier in my code:
-@images.each do |img|
-link_to eval(params[:action] + '_image_path(img)') do
=image_tag img.image.url(:thumbnail)
But this is not working. Why not?
-link_to eval(params[:action] + '_image_path(@featured_image)') do
=image_tag @featured_image.image.url(:display)
I am seeing "Uncaught TypeError: Cannot call method 'bind' of undefined" There seems to be an issue w开发者_如何学JAVAith calling _image_path(@featured_image)'. :(
Is it possible that @featured_image
is undefined? That seems like what's happening here.
精彩评论