#1 This is not working:
$('.someclass').fancybox({
type: 'ajax',
href: 'name_of_partial1',
})
#2 This is working:
$('#some_id').fancybox({
type: 'ajax',
href: 'name_of_partial2',
})
Partial 1 and Partial 2 are in the same directory. #some_id and .some_class are elements on two different actions in the same controller.
All I want to do is render a partial inside of fancybox, is using the fancybox href option the proper way to call a partial inside of the fancybox?
The error I’m getting with the second one is the fancybox pops up with “The requested content cannot be loaded. Please try again later” and I get a 404 in the console.
When I change the href in #2 to:
href: 'name_of_partial1'
Then I see partial 1 get rendered in the fancybox.
To self:
Turns out that the href: ” option maps to the controller action. I was getting a 404 because name_of_partial2 had a controller action that by the same name, but there was some no-good render happening in that action that was throwing a 404