Does Rubi On Rails Generate XHTML or Accessible HTML ?

Hi.

I've been testing different generated with Rubi On Rails pages for web Accessibility.

Is there a way of making them in accesible HTML or XHTML?

Thanks.

Yes. Make your own views, if the generated ones (using scaffolding) don't fit your needs. Rails can generate crappy HTML or stuff that passes strictest of accessibility guidelines (or XML or even plain text).

Vish

VPC wrote:

I've been testing different generated with Rubi On Rails pages for web Accessibility.

Is there a way of making them in accesible HTML or XHTML?

After a "functional" test that calls get :index or similar, the returned HTML is stored in html_document.root

I triggered a thread about XHTML recently; the output is reputedly as well-formed as our browsers will permit.

(Funny how that excuse always works, even in Rails!)

To test for accessibility, I would start here:

  def accessible?

    File.open('scratch.html', 'w') do |fh|       fh.write(html_document.root)     end

    system('tidy scratch.html')   end # CONSIDER better system to trap syntax errors in rhtml

Now Tidy will scan the HTML and complain about things like missing ALT tags. Many other accessibility validators are probably available, too. Add command line arguments to Tidy to make it force XHTML, if you need that.

You can change system('') to `` to collect the report in a string, and search it with regular expressions, to let accessible? return a boolean, instead of just spew!

If you want to test accessibility (as distinct from testing validity), there is a this -Automated Accessibility Tests with RAAKT in Ruby on Rails – Standards Schmandards