0

When doubleClick an element, I'm trying to get a url, then pull the replace the html of #propertiesBox with the contents of that url.

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

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

});

The url I want to get is views/ui/_propertiesBox.html.erb

3
  • You have the controller action/route for /ui/propertiesBox url? Commented Apr 13, 2014 at 19:44
  • Could you please share your routes.rb file. Commented Apr 13, 2014 at 19:45
  • Nothing in my routes.rb file about ui or propertiesBox. Should I add something? Commented Apr 13, 2014 at 19:47

1 Answer 1

2

You need a route for that url:

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

And appropriate action in controller:

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

To make it happen.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.