I'm looking at the Sharre social mediq jquery plugin http://sharrre.com/# Below is an example of how to use it.
simple_jquery_social.js example:
$('#sharrre').sharrre({
share: {
googlePlus: true,
facebook: true,
twitter: true
},
url: 'http://sharrre.com'
})
So in normal rails usage, I would add the above in my assets directory (along with the sharrre jquery lib stuff), put a 'div id=sharrre' tag in my view, and I'd be done. But I would like to make a rails helper function to use in my .html.erb view template and dynamically decide whether or not to display google plus, for example. So I would want something like:
<%= my_helper :googlePlus=>false %>
Then my environment should know that the googlePlus variable in the jquery code above would now be false, and hence the googlePlus button would not be displayed. **The whole point is to to control a lot more options available in the jquery plugin dynamically thru Rails. But to do that I need to be able to set jquery variables dynamically through Rails. I realize the above example is trivial because I could just change the jquery variable by hand, but by doing it through Rails, I could also set the url param dynamically, which is something I want to be able to do so people can recommend particular pages.
What is a good mechanism for accomplishing this, or is it even possible?