Blog

Mar
18

Ruby on Rails 2.3 Searchable API Doc

Posted by Michael Cindric in development, ruby on rails | No Comments »

A developer by the name of Vladimir Kolesnikov has put together a nice little searchable API doc for rails. Its been updated for rails 2.3.2 (Latest Version) and you can either download it or browse online. Currently its been tested with Safari 4, Firefox 3, Opera 9.5 Internet Explorer is currently unsupported but who uses IE anyways.

You can download it here

Mar
17

Rails 2.3 is out

Posted by Michael Cindric in development, mac osx, ruby on rails | 1 Comment »

Finally Rails 2.3 is out. Officially its tagged as 2.3.2 from memory. So what are you waiting for update already. Just run the following command in your terminal and your on your way. Sorry windows users find your own way

 sudo gem install rails

Check out the release notes here

Mar
11

Please accept the terms of service and privacy policy

Posted by Michael Cindric in ruby on rails | 3 Comments »

If you need users the accept the terms of services and privcay policy or your rails application there is a simple way to handle this without a database field or javascript. It’s using the validation methods built into rails. Simply add the following code to your User model for example

validates_acceptance_of :terms_of_service

Then in your view add the following to your view and you will get a checkbox on the page that users will be required to check.

<%= check_box :user, :terms_of_service %>

This will then add this validation rule to your models validation rules and when you try to submit the form without checking the checkbox you get a nice little validation message letting you know hey you need to accept this.

Of course you can have your own validation message displayed like so

validates_acceptance_of   :terms_of_service, :message => ' and the privacy policy must be accepted'