string dump of models appearing in views in Rails 4.2.1 - erb

I have three Rails projects on 4.2.1 and at the bottom of all my views where the .erb is operating on a model, it dumps it out a string of the model into my view. It's really annoying me and I can't figure out how to get rid of it. Anybody else seen this or know what's up?
I've double/triple checked, I'm an not adding any <%= model.inspect %> anywhere in my view. I am passing the model down through partials, but doubt that has anything to do with it... Thanks for any advice.

Related

How to avoid duplication documentation with angular

I'm writing a documentation with angular.
For now, i duplicate twice the code. Once in the button.component.html to make the componenbt appear, and the other is injected from the button.component.ts as a string so it's not interpreted.
The goal is to show the result you will get if you tips the code contain in pre balise.
I need to avoid these duplication cause when a component change, i need to modify twice the code.
I first have use to simulate include comportement but it's not working as the final content is the generated content and not the original content.
Then i checked how angular material perform for their documentation, and it's same to be a bit tricky and complicated for me has they inject their component as dependancies.
I'm asking if there is a sample way to avoid this duplication content and if someone have faced the same issue.
I have only one idea, it's to run a shell commande in the end of ng build with webpack and node, and get the content of the target block and inject directely in the target balise.
Sample :
<div class="my-5" data-source="myButton">
<button mat-button>
<mat-icon class="icon-left">help</mat-icon>
Support center
</button>
</div>
<code data-target="myButton"></code>
But i'm not very sur about that solution.
Thanks in advance.
Kevin
For people who have face the same problem, there is the module you have to use :
exemplify-angular
It's do the job perfectly.
Kevin

Sharepoint SPFx ${} replace slash with space in render method

I'm pretty new to spfx client side development model and there is some stuff that I don't understand.
In sharepoint webpart (SPFx) I'm trying to dynamically load an image src, but if I do: src="${item.ImageUrl}" the slashes (/) are replaced by spaces. But if I do it manually: src="https://picsum.photos/720/300/?image=0", the image is shown without problem.
Any help would be appreciated!
Thanks!
It was my mistake!
<img class="${styles.image} src="${item.ImageUrl}" alt="${escape(item.Title)}" />
Its missing the " after the class styles, so for a strange reason the url makes that thing.
This teach me a valuable lesson. If something doesn't work just go home and try tomorrow :)

xpages tag cloud: links are missing

I'm tryng to use the tag cloud control from Ext.Library 9.0.1 (20160428). The cloud is generated with the correct values form the category view but all the links are missing.
I suspect I'm missing something stupid and my question will look a little bit silly but... I've already lost some hours on this without getting any result.
This is the code for the tagcloud:
<xe:tagCloud id="tagCloud1" sliderVisible="true">
<xe:this.cloudData>
<xe:dominoViewCloudData categoryColumn="0" viewName="indice"LinkTargetPage="/risultati.xsp" linkRequestParam="nometag">
</xe:dominoViewCloudData>
</xe:this.cloudData>
</xe:tagCloud>
This is what I get in a browser (just an example, all the lines look similar):
<li style="display:inline">
<a role="link" title="11 Entries" class="tagCloudSize9">Miscellaneous</a>
</li>
As you can see there is no link to anything, so the user can't click the cloud label.
Any advice will be appreciated
Thanks in advance
It seems it was only a cache-related trouble. I've restarted my server and it started to work as expected.
Just wondering why and how to avoid in the future...

Selecting parent elements with WebdriverJS

I'm trying to create some scripts which require moving through a lot of on-the-fly HTML with random IDs. They require getting the parents of an element - but I'm not sure how to implement this in WebdriverJS.
If I access the element I want via a console, I can do the following to get it;
document.querySelector('span[email="noreply#example.com"]').parentNode.parentNode
Is there a way to do this in WDJS? I've looked and can't see anything obvious - it's specifically the parent stuff I'm having issue with. I saw that a possible solution may be xPath however I'm unsure of syntax having never used it before.
Thanks in advance!
I don't know the syntax of WebDriverJS. But the XPath is as below, you need a way to fit it in somewhere.
This is based on your CSS Selector, so please show HTML if needed.
.//span[#email='noreply#example.com']/../..
For example, if you have HTML like this
<div>
<div>
<span email="noreply#example.com">Contact me</span>
</div>
</div>
You can avoid using .. to go up.
.//div[./div/span[#email='noreply#example.com']]
If you have more levels to look up, another handy method would be using ancestor from XPath Axes.
Also, as #sircapsalot brought up, CSS selectors spec doesn't support parent selecting, so XPath is the only way to go, unless you inject JS.

Text box resize issue: difference between BIDS and browser rendering

When designing and previewing a report in BIDS everything looks fine, but once rendered in a web browser the text boxes resize. I've tried a few things to stop this including using rectangles as place holders. Does anyone know of a workaround for this?
Here are some screenshots. First design view:
Render view:
In my experience, SSRS is not a very good tool for precise rendering. I've had the issue describe in various forms before, and can only offer a few options:
Don't care. Design your report in a way that it doesn't matter how it's exactly rendered.
Focus on one renderer. Don't optimize for both the BIDS Preview and the HTML rendering, but only on the final one (probably HTML). Note that with HTML you do have to deal with cross-browswer issues.
Use tables for layout. I know, this is frowned upon in CSS land, and I personally don't like it either. But a matrix may be your best bet at approaching pixel-perfectness, and from your screenshot it even looks like you have tabular data so it's even possible to rationalize the choice.
Choose another renderer. Deliver your report in Excel instead of HTML. With Excel it should be easier to get to a nicely layouted table.

Resources