2014-04-13 9 views
0

요소를 doubleClick 할 때 url을 얻으려고 시도하고 나서 해당 URL의 내용으로 #propertiesBox의 html을 대체하십시오.Rails AJAX URL을 찾을 수 없습니다.

$('.elemContainer').dblclick(function() { 

    $.get("/ui/propertiesBox", function(data) { 
     $("#propertiesBox").html(data); 
     alert("Load was performed."); 
    }); 

}); 

내가 얻을하고자하는 URL이 views/ui/_propertiesBox.html.erb

+0

/ui/propertiesBox URL에 대한 컨트롤러 작업/경로가 있습니까? – drKreso

+0

'routes.rb' 파일을 공유해주십시오. –

+0

u routes 나 propertiesBox에 관한 내 routes.rb 파일의 내용이 없습니다. 뭔가 추가해야합니까? – colmtuite

답변

2

당신은 해당 URL 경로가 필요하다 :

#routes 
get 'ui/propertiesBox' => 'some_controller#properties_box' 

그리고 컨트롤러의 적절한 조치 :

#controller 
def properties_box 
    render :partial => 'propertiesBox' 
end 

그것을 만들려면 우연히 있다.

관련 문제