How can I make this on multiple lines. I tried but it does not work.
$('#wall-top').after("<div id='buttons' style='display: block;'><%=escape_javascript(link_to (image_tag 'btn-post-greeting.png', :width => '241', :height => '68', :alt => 'Btn Post Greeting', :id => 'BtnBoxGreeting'), new_greeting_path, :remote => true) %><%=escape_javascript(link_to (image_tag 'btn-invite-friends.png', :width => '245', :height => '68', :alt => 'Invite Friends', :id => 'BtnBoxFriends'), new_greeting_path, :remote => true, :style => 'display: block;') %></div>");
Pull the ERB chunks out into separate JavaScript variables, format the ERB any way you want, and then paste it all together in JavaScript land. Perhaps something like this:
That should get you started. I’d go a bit further and move the
styleattributes into your style sheet; that would cut down on the noise and give you a cleaner separation of concerns.