lundi 13 juin 2016

How do I call a method in application helper from a assets/javascript/partial?

Hi I am new to Ruby on Rails development.

I have a function in application_helper.rb

def fb_like_button(url)
    content_tag(:iframe,nil, src: "//www.facebook.com/plugins/like.php?href=#{url}width=83&layout=button_count&action=like&show_faces=true&share=false&height=21&appId=xxxxxxxxxxxxxxxx")
 end

This function is working in views i seeing facebook like button in webpage

But its not working in partials.

app/assets/javascript/partials

this is my partials index.html.slim

.row
   | 

From the above code its running without any error but i didn't see facebook like button in the webpage.

Please Advice me on this issue

Thanks in Advance.

Aucun commentaire:

Enregistrer un commentaire