Hi,
I'm trying to apply an icon to a jquery UI styled button in my Rails app. The button is styled correctly but I just can't get the icons to show up! Could anyone give me any suggestions - I'm pulling my hair out!
I've done the following:
1) Copied the javascript files (jquery-1.4.2.min.js and jquery-ui-1.8.2.custom.min.js) to public/javascripts
2) Copied the entire smoothness theme directory to under public/css
3) Added the following code to my layout file to include the relevant files:
<%=stylesheet_link_tag 'smoothness/jquery-ui-1.8.2.custom', :media => 'screen, projection'%>
<%=javascript_include_tag 'jquery-1.4.2.min', 'jquery-ui-1.8.2.custom.min', 'application'%>
4) Added a 'save' class to the button I want styling:
<%= submit_tag 'Save Changes', :class => 'save' %>
5) Added the following to the application.js file:
$(document).ready(function() {
$(".save").button( { icons: {primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'} } );
});
(Until I get it working, the code in step 5 is copied and pasted from the docs - I've just changed the selector)
The button picks up the theme's style - but I'm having no luck getting the icons to show up - have I missed a step?
Many Thanks,
Ash