I just implemented the solution https://prerender.io/ with Rails and 
Angular. It was relatively painless.

There were a few tricky parts

When you actually try to visit one of your own pages like:
http://mypage.com?_escaped_fragment_=
rails chokes because (in my case) it is single threaded. So it means a 
sitemap is required to completely index my site using this method.

I testing the output by pasting the test url into the prerender.io 'cached 
pages' page with the 'add url' button then checking out the 'raw html'. 
>From there I could go to http://mypage.com?_escaped_fragment_= and get the 
expected result.

I also had to use the prerender.io feature wait for render
https://prerender.io/getting-started#wait-for-render

I added the window.prerenderReady = false to my application.js, but it 
could probably just go in the link function of the directive I used below.
 
https://gist.github.com/jibwa/10694880



On Thursday, May 30, 2013 10:12:06 AM UTC-4, Michael Natkin wrote:
>
> Cool, thanks! I ended up going a different way, writing a rails-side 
> controller to render a super minimal version of our recipe page when it 
> sees _escaped_fragment_. That will get me through for now, but as our site 
> becomes more complex (chefsteps.com),  we might need to move move to the 
> zombiejs solution.
>
>
> ----------------------------------------------------------------------------------------------------------------------------------
>
>
> Michael Natkin
> CTO
> http://ChefSteps.com <http://chefsteps.com/>
>
>
> On Thu, May 30, 2013 at 7:03 AM, Ben Kitzelman 
> <[email protected]<javascript:>
> > wrote:
>
>> hmm its hard as the snapshotting process relies on a headless browser.... 
>> You could still use the gem with minimal effort, if you feel like 
>> contributing, by writing a driver using Bokor - a wrapper gem for zombiejs 
>> - a js implementation of a browser - it would probably render faster too. A 
>> driver really should only be 10 - 15 lines of code
>>
>>
>> On Thursday, May 2, 2013 2:15:23 AM UTC+10, Michael Natkin wrote:
>>>
>>> Ben, I was all excited to use your gem, but then I realized it is 
>>> hard/impossible to use capybara on heroku. Know of anyone working on any 
>>> alternatives that can live on heroku? 
>>>
>>> On Saturday, April 13, 2013 2:10:49 AM UTC-7, Ben Kitzelman wrote:
>>>>
>>>> If your running a ruby app and want to adhere to the google ajax 
>>>> crawling scheme - there's a gem that implements the crawler detection and 
>>>> snapshotting for any rack app....
>>>>
>>>>     gem install google_ajax_crawler
>>>>
>>>> writeup of how to use it is at http://thecodeabode.blogspot.
>>>> com.au/2013/03/backbonejs-and-seo-google-ajax-crawling.html, source 
>>>> code at  https://github.com/benkitzelman/google-ajax-crawler
>>>>
>>>> -Ben
>>>>
>>>> On Tuesday, October 18, 2011 3:43:59 AM UTC+11, Chris Smith wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> One of the things I like most about the Angular framework is that it 
>>>>> allows me to create purely client-side templates. My backend just focuses 
>>>>> on providing data, and everything else I can do in JavaScript and HTML.
>>>>>
>>>>> However, it just dawned on me that having a website where all my 
>>>>> content is obtained via AJAX means that the site cannot be indexed by 
>>>>> Google out of the box. My understanding, is that I need to handle special 
>>>>> GoogleBot directives and serve static web pages at a different URL. (See 
>>>>> http://code.google.com/web/ajaxcrawling/docs/getting-started.html.)
>>>>>
>>>>> Since I am new to this concept, is there an easy way to work around 
>>>>> this? E.g. automating the generation of an *HTML snapshot* for the 
>>>>> Google crawler? Or, is this something that is platform dependent? (For 
>>>>> example, I saw a solution using an HTML unit testing framework when 
>>>>> running 
>>>>> on AppEngine.)
>>>>>
>>>>> Any insights on how the Angular community deals with this would be 
>>>>> very helpful.
>>>>>
>>>>> Thanks,
>>>>> -Chris
>>>>>
>>>>  -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "AngularJS" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/angular/yClOeqR5DGc/unsubscribe?hl=en-US
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/angular?hl=en-US.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to