Tuesday, 6 March 2012

Ruby on Rails Page Titles


Accurate page titles are an important part of the SEO for any website. However the architecture of a modern web application relies on the content for each individual page being surrounded by a single layout to help keep the overall layout easy to maintain.

This can have a detrimental effect on SEO as Google (and the others) don’t approve of repetition of page titles as it doesn’t provide helpful information to your users. 

The Rails Approach to Page titles

Let’s setup your app so you can have custom page titles and a fall back title for those you forget.
First in your application.html.erb file (or the page you are using for the layout) add this line of text:

<title><%= content_for?(:title) ? content_for(:title) : "Beo | London based results driven web design & development" %></title>


Here are the standard <title> tags for your website with a dynamic bit of code in-between. The code looks to see if you have a custom title and if not displays the default page title (but remember this is something we are trying to avoid!).  

Next we need to add in the method referenced above, in your application_helper.rb file add this:

def title(page_title)
  content_for(:title) { page_title }
end




Now we need to go to each of our individual pages and insert a line of code, for example on our services.html.erb page we have:



<%- title "Beo | London based results driven web design & development | Services" %>


Again, it’s pretty simple, the code passes the hard coded title to the helper which in turn passes it to the application layout.

Go through each of your pages adding in some custom text for each title.

SEO tips from www.beo.so







76 comments:

  1. well written article but for ror application development professionals they are also very good.

    ReplyDelete
  2. Such a wonderful post. Ruby on Rails Development is one of the most popular application development now-a-days. We are also providing some good tips related to this post.

    Great work.


    Asp.net Development

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Nice Information Sharing Regarding Installing Ruby on Rails. This is a very good topic to talk thanks for posting this information.

    ROR Development India

    ReplyDelete
  6. Such a great post of your blog. OnGraph Technologies is one of the most popular Ruby on Rails Development Company India. We are also providing some services as Ruby on rails development and Ruby on rails software development.

    ReplyDelete
  7. We are a leading software development company delhi,India which works as per the client requirements and give provide software.

    ReplyDelete
  8. I Really like your good infomation,Thanks
    and please keep sharing it with us.
    Visit us:
    Website Designing Company London
    Web Development Company London

    ReplyDelete
  9. Thanks for sharing this quality information with us. I really enjoyed reading. juegosjuegos.com | juegos de matar zombies | jogos do friv

    ReplyDelete
  10. This is a great article. It gave me a lot of useful information. thank you very much.
    Signaute:
    Visit to friv than play games2girls and play game kids games online ! have fun!

    ReplyDelete
  11. I would like to thank you for the efforts you have made in writing this article.
    Signature:
    Jugar juegos de frozen en línea gratis, los nuevos de princesa de Disney juegos frozen - la princesa encantadora y linda. Divertirse frozen!

    ReplyDelete
  12. I also think that the problem will be solved play unblocked games very nice , free unblocked games online to play , descargar whatsapp gratis chat limit , unblocked games , unblocked games , descargar whatsapp gratis

    ReplyDelete
  13. Thanks for sharing the information. It is very useful for my future. keep sharing
    Signature:
    download descargar facebook gratis para Android celular and download free descargar facebook apk and descargar facebook gratis , descarga facebook

    ReplyDelete
  14. Its really good information, i like your blog post. Thanks for sharing
    Signature:
    download free descargar whatsapp plus and download baixar whatsapp plus online and descargar whatsapp , baixar whatsapp gratis

    ReplyDelete
  15. The article you have shared here very awesome. I really like and appreciated your work. I read deeply your article, the points you have mentioned in this article are useful
    Signature:
    facebook entrar iniciar sesion gratis - Sitio Oficial iniciado sesión en Facebook lengua española. facebook entrar rápido, facebook iniciar sesion en tu cuenta de entrar facebook

    ReplyDelete
  16. Thanks for all your information, Website is very nice and informative content.
    Signature:
    download baixar facebook movel, Facebook movel, baixar facebook. Facebook chat, baixar whatsapp, fazer o download baixar whatsapp gratis para Android, iPhone. Últimas Facebook

    ReplyDelete
  17. I would like to thank you for the efforts you have made in writing this article.
    Signature:
    Versión en facebook en español descargar a los países hablan Español: facebook entrar direto agora , facebook en español para and facebook entrar direto

    ReplyDelete
  18. Thanks for sharing the information. It is very useful for my future. keep sharing
    Signature:
    The place to play all unblocked games online. Here you can find every blocked games such as: unblockedgames , unblocked games happy , unblocked games 77 , gmod

    ReplyDelete
  19. Currently every business requires a website to represent itself over the internet. For representing better way you need to use professional web design and development services.
    Web Development Company London | Web Design Companies London

    ReplyDelete
  20. Thanks for sharing this quality information with us. I really enjoyed reading. I think I need it.
    Games for girls|
    Kizi 1|
    Kizi 2

    ReplyDelete
  21. Hello, just wanted to say, I loved this article. It was practical.
    happy wheels
    super mario bros
    pacman
    agario

    ReplyDelete
  22. Thanks for all your information, I hope it will be helpful for too many people that are searching for this topic.
    Signature: agario is a multiplayer browser game in which players have to eat competitors or be eaten while striving to dominate the world of colorful cells. In agario game, you start off with a small circle and eat smaller static circles and other smaller players. Once you get big enough you will get addicted. With agar io, you have an option to split your circle in two and throw one half at the other players with larger speed, in order to gain more mass. You have the option to play agar.io in a Free For All mode, where you play against everyone, or you can play in teams. Play agario skins online game for free with your friends now!

    ReplyDelete
  23. Thanks for your great article friend, i get new information, new ideas to do somethings, i hope you will share again, i keep waiting for next post, thanks.
    Friv 4
    Kizi 3

    ReplyDelete
  24. Thanks for all your information, I hope it will be helpful for too many people that are searching for this topic Pirate Kings banana kong.

    ReplyDelete
  25. Thanks for all your information, I hope it will be helpful for too many people that are searching for this topic Pirate Kings banana kong.

    ReplyDelete
  26. This is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this.

    Geometry Dash |Geometry Dash Apk | Sonic Dash game | Sonic games|Square Quick app |Square Quick|Dr Driving Game| Dr Driving 2 |Trollface Quest 2|Trollface Quest|Papa Louie 2|Papa Louie

    ReplyDelete
  27. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write.
    Friv 10

    ReplyDelete
  28. Thanks a lot for sharing such a nice article. We are working on ROR from last more than 5 years. We offer best price in the industry and complete value of money to clients. We are one of the best companies offering ruby on rails development in India.

    ReplyDelete
  29. First You got a great blog.I will be interested in more similar topics.
    Signature:
    i like play games happy wheels online and play happy wheels 2 games and agario , fireboy watergirl , agar io

    ReplyDelete
  30. You need to kill time, you need entertainment. Refer to our website. hope you get the most comfort.
    Thanks you for sharing!
    Yepi
    Kizi
    Friv
    Friv Games

    ReplyDelete
  31. You are stressed and tired, you need entertainment. Refer to our website. hope you get the most comfortable.
    Kizi 4

    ReplyDelete
  32. you'd have time to look these kids active. Please visit our website and let us play the game interesting.
    Thanks for sharing !
    Friv 10
    Kizi 10
    Yepi 2

    ReplyDelete
  33. Thanks for the best blog.it was very useful for me.keep sharing such ideas in the future as well.this was actually what i was looking for,and i am glad to came here!
    Friv

    ReplyDelete
  34. thank you for your interest in welcome visit
    Friv 4

    ReplyDelete
  35. New attractive game . I will play it every day
    Friv|
    Friv 2

    ReplyDelete
  36. When you're tired, you want to relax after a stressful working hours, you need to have time to take care of the kids active.
    Please visit our website and play exciting flash games.Thanks you for sharing!
    Friv 4

    ReplyDelete
  37. Play the Best Free Games! We've picked out the racing games, cooking games, candy crush, games shooting, fashion games, ...
    Thanks for sharing !
    Kizi 200
    Friv 1
    Y88
    Y9

    ReplyDelete
  38. You want to relax after a stressful working hours. Refer to our website. hope you get the most comfort.
    Thanks for sharing !
    Friv 100
    Friv 8
    Friv 2

    ReplyDelete
  39. You want to relax after a stressful working hours. Refer to our website. Hope you get the most comfort.
    Thanks for sharing !
    GirlsGoGames
    Kizi 100
    Frvi

    ReplyDelete
  40. Thanks for sharing this information we have experts Ruby on Rails developers in india as well as have knowledge of SEO but we this blog my ideas are cleared more about SEO. For ruby on rails development contact us at: info@cryptextechnologies.com

    ReplyDelete
  41. This comment has been removed by the author.

    ReplyDelete
  42. Cool Runnings Found your site from a friends Facebook link, Heavy Weights | Rookie of the Year it seems that you have growing fanbase and I now understand why Super informative article, thanks a million. Best Action Movies

    ReplyDelete
  43. The blog or and best that is extremely useful to keep I can share the ideas. Age Of War 2
    Big Farm | Slitherio | Tank Trouble
    Of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
    Happy Wheels | Goodgeme Empire | Slither.io

    ReplyDelete
  44. Thanks for sharing this good stuff! Keep up the great work, we look forward to reading more from you in the future!
    Friv 100

    ReplyDelete
  45. You want to relax after a stressful working hours. Refer to our website. Hope you get the most comfort.
    Thanks for sharing !
    GirlsGoGames
    Kizi 100
    Frvi
    gold Miner 2
    unfair Mario 2
    cubefield 2
    tanki Online 2

    Friv Games
    Y2
    Friv 200

    ReplyDelete
  46. I like your post. It really useful with me. Thanks for sharing these useful information!
    happywheels3game.com

    ReplyDelete
  47. Great post. If you are looking for developers who work on Ruby on Rails in India, then Cryptex Technologies is the best Ruby on Rails web Development in India. For any queries email us at: info@cryptextextechnologies.com

    ReplyDelete
  48. Its really good information, i like your blog post. Thanks for sharing

    http://word-cookies-answers.com

    ReplyDelete
  49. I was very impressed by this post, this site has always been pleasant news. Thank you very much for such an interesting post. Keep working, great job! In my free time, I like play game: facebooklite.com.br. What about you?

    ReplyDelete
  50. Thanks for the information you shared. Please share useful information with your friends regularly
    papasgamesonline.com

    ReplyDelete
  51. I like your post. It really useful with me. Thanks for sharing these useful information!
    happywheels3game.com

    ReplyDelete
  52. This article is really fantastic and thanks for sharing the valuable post.
    www.appbaixar.com

    ReplyDelete
  53. I understand what you bring it very meaningful and useful, thanks.
    www.baixar-whatsapp.com.br

    ReplyDelete
  54. I realize that nothing is fair but I'm still trying. I just want to do my best and what is possible
    instagram online viewer

    ReplyDelete
  55. Thank you, so Much admin have a nice day :) you information about weight loss is very easy and simple.
    pocafashion.com

    ReplyDelete
  56. I like to get up early to go out and breathe fresh air. I feel that it is good for health and a good habit
    19216811ll.com

    ReplyDelete
  57. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know. Nice! thank you so much! Thank you for sharing.
    http://b612az.com

    ReplyDelete
  58. I often get emotionally involved. Like when I read your post, I can cry, laugh, sad, funny, depending on your written words. I think you are a sensitive person.
    www.facebookbaixargratis.com.br

    ReplyDelete

  59. Friv 2017 is new flash games which are expected to be the best Friv 4 games to play. You can find all game Friv 4 school free in Friv 2017 and Friv 4 School .
    Friv 2017
    Tủ nấu cơm
    máy làm Ðá
    friv 2018
    friv 4
    friv 4 school
    friv for school
    friv

    ReplyDelete
  60. It seems I'm on the right track, I hope I can do well. The result was something I did and was doing to implement it.
    www.clickjogosclick.com

    ReplyDelete
  61. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work.

    supersmashflash2s.com

    ReplyDelete
  62. I have read your article, the information you give is very interesting.
    pocatravel

    ReplyDelete
  63. Your article is very interesting. I think this article has a lot of information needed, looking forward to your new posts. Get permission to share:
    returnman3game.com

    ReplyDelete
  64. Your post is interesting. Hope you have more useful posts like this
    vex3.games

    ReplyDelete
  65. Your blog posts are more interesting and impressive. I think there are many people like and visit it regularly, including me.I actually appreciate your own position and I will be sure to come back here.
    brtaram

    ReplyDelete
  66. I read this article. I think You put a lot of effort to create this article. I appreciate your work.
    thesis Writing Service

    ReplyDelete