So I'm just trying to add links to social networks (facebook, g +, addthis ect) to one of my flash messages when a user successfully uploads a file. I have all the code in partial, so I thought I could just do it, but I just get a bunch of "/ n" and html_safe is not working.
here is my part:
<div class="share_buttons">
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_stumbleupon"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4e8b938653ac0cd3"></script>
</div>
<script type="text/javascript">
reddit_target='tattoos'
</script>
<script type="text/javascript" src="http://www.reddit.com/static/button/button1.js"></script>
<% content_for :jquery do %>
<%= javascript_tag do %>
$(document).ready(function() {
$(".share_buttons a").live("click", function() {
$.ajax({
url: '/index/share?id=<%= @tattoo.id%>',
type: 'post'
});
return false;
});
});
<% end %>
<% end %>
And in my controller, I tried this:
flash[:success] = "Thanks, feel free to share that out! #{render :partial=> /shared/social_buttons} "
source
share