I'm building a website involving recipes and I have some content being loaded through an iframe from another site, I would like to remove it's headers/footers and just really manipulate a specific part of the foreign HTML so i can just display that. I was first thinking using jquery or angularjs to solve the problem, but I started thinking of if I could pass the url from an onclick (I already have that function sorted out below):
AngularJS:
$scope.currentRecipeUrl = "";
$scope.trustSrc = function(SrcToBeTrusted) {
return $sce.trustAsResourceUrl(SrcToBeTrusted);
};
$scope.changeWeeklyRecipe = function(recipeUrl) {
$scope.currentRecipeUrl = $scope.trustSrc(recipeUrl);
};
HTML.ERB:
<iframe id="displayedRecipe" src="{{ currentRecipeUrl }}"
to my Rails controller so I could just inject the specific part of the html that I wanted into the view.
Can anybody think of a way I might be able to accomplish that?
EDIT: I forgot to mention that the changeWeeklyRecipe function is being called on the on-click event.