Am I mapping my routes correctly

I am trying to implement shallow routes (being able to list the index of a model through the parent model but without have to access child records through the parent on other actions than index)

  resources :books, do
    resources :chapters, :shallow => true

the following routes should now be usable,




but I get a routing error

No route matches {:controller=>”chapters”}

What am I doing wrong?

I can code it to do /books/1/chapters/6/edit for example but I would rather it use shallow routes.

The end of black hat SEO copywriting?

SEO is something of a dirty word, particularly for many legitimate web developers. It’s no wonder, with so many ‘black hatters’ out there clogging up the internet with their rubbish content.

Thankfully, Google is well aware of black hat and is constantly revising its algorithm in order to prevent this sort of trickery. In this post, Martin Harrison of copywriting agency Copify takes a look at some of the common black hat tricks employed by SEO copywriters and the reasons why they no longer work.

Keyword stuffing

Time was, the only thing you needed to do in order to rank on Google was stuff your targeted keyword in there a dozen or so times and bingo, first page ranking. This resulted in a lot of poorly written, spammy copy like this:

“Do you like spammy SEO copy? Well you’ve come to the right place, because here at we are spammy SEO copy experts. This is a one stop shop for all of your spammy SEO copy needs.”

Thankfully, this is no longer considered SEO best practice as Google has become much more advanced in the way that it indexes content, looking at aspects such as semantic relevance and domain authority to establish whether or not a page is relevant to a query.

Excessive linking

Exact match anchor links are still a big factor in SEO, but some people take it to the extreme, linking every second word on their site. This technique may have worked once, but nowadays Google is wise to it, and the more links you put on a page the less valuable they become.

Hidden text

White text on a white background used to be a common black hat trick to get a page to rank, without offending anybody with rubbish copy. Now, it’s likely to lead to your page, if not your whole site being taken out of Google’s index.

Write for humans first, spiders second

If you want to create a great website, it’s important to remember the golden rule, write for humans first and foremost. That way, you will have copy that sells your products and services effectively and provides real value for visitors. As a result, you are much more likely to create something that people will naturally want to share and return to, which is far more valuable than any black hat SEO.

Posted in SEO

How do you resize a webbrowser control to fit on a html element?

I thought I had found the solution to this problem in the following question, but it does not behave as planned.

So I am pretty much struggling with this, but I guess if the answers can go in here it will be as useful on here than it is on stack overflow

I am loading some html content into a div that is inside of a webbrowser control, when the page has loaded I pass the height of the div back to the control with this.


and in the ScriptNotify call back i’m currently doing to something like this

private void PlayerBrowser_ScriptNotify(object sender, NotifyEventArgs e)
   PlayerBrowser.Height = Convert.ToDouble(e.Value) * 0.5;

some values return but when the content is snug at the top of the webbrowser control i will truncate some of the content from the bottom.

and when i adjust the height (by changing 0.5 to another number) so that there should be more than enough space to fit the content in, it will centre it all vertically and then still truncate the bottom of the control.

my html is being specified like this.

string newHtmlString = "<head><meta charset='Windows-1257'><meta name='viewport' content='width=device-width' />" +
  "<meta name='viewport' content='user-scalable=no' /><meta name='viewport' content='initial-scale = 1.0' />" +
  "<meta name='HandheldFriendly' content='true' /><meta name='target-densitydpi=device-dpi' /></head>";

newHtmlString += "<body        onLoad="window.external.notify(''+document.getElementById('content').offsetHeight);" ><div id='content'>";            
newHtmlString += htmlContent + "</div></body>";

this code is closest i’ve found up to now for the solution to my problem, so It would be nice for someone to let me know where I have gone wrong.

Posted in Uncategorized