Firstly my Jquery knowledge is very limited but am reading and practicing to remedy this, so please bear with me if this is a really basic question. As the title states i am getting a error message within my rails app
$(".share a").button is not a function
My application.js file contains this
$(function() {
$(".share a")
.button()
.click(function() {
var a = this;
// first set the title of the dialog box to display the folder name
$("#invitation_form").attr("title", "Share '" + $(a).attr("folder_name") + "' with others");
// a hack to display the different folder names correctly
$("#ui-dialog-title-invitation_form").text("Share '" + $(a).attr("folder_name") + "' with others");
// then put the folder_id of the share link into the hidden field "folder_id" of the invite form
$("#folder_id").val($(a).attr("folder_id"));
// the dialog box customization
$("#invitation_form").dialog({
height: 300,
width: 600,
modal: true,
buttons: {
// first button
"Share": function() {
// get the url to post the data to
var post_url = $("#invitation_form form").attr("action");
// serialize the form data and post it the url with ajax
$.post(post_url, $("#invitation_form form").serialize(), null, "script");
return false;
},
// second button
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
}
});
return false;
});
});
And my view page containds this to call the jquery ( I think)
<div class="share">
<%= link_to "Share", "#", :folder_id => folder.id, :folder_name => folder.nameunless @is_this_folder_being_shared %>
</div>
Can anyone advise why I am getting this error as from what i can see it should be working, I.E. when i click a button labelled share I should get a popup window appear with my invitation form.
Any help appreciated as I am now stuck at this point