0

In my Rails app I have a Ajax call to update a property:

def add_properties
    @conversation = Conversation.update(params[:conversationId], :points=> => params[:conversation][:points])

    respond_to do |format|
       format.js { render :partial => "add_properties" }
    end
end

And my _add_properties.js.erb is simple:

$('#ajaxFeedback').html('Property updated').show().fadeOut(4000);

What I am finding is that the call to the partial is choking due to some JQuery UI declarations in my application.html.erb. When I remove the declarations, all works well. How can I simply render the partial without calling the application.html.erb?

Any help would be appreciated!

4

2 回答 2

1

你有没有尝试过?

format.js { render :layout => false, :partial => "add_properties" }

于 2013-02-16T00:04:09.133 回答
0

为什么不把它重命名为add_properties.js.erb

称呼

respond_to do |format|
  format.js
end
于 2013-02-15T21:52:27.933 回答