New Plugin - Personalise Site

30 September 2007
Scott Sherwood

This plugin provides helpers for your views that allow you to gain implicit data about the user browsing the site.

This is intended to be used to customise what the user see's, maybe to improve usability or for cross-browser issues

The following methods are available:

Returns the name of the browser the user is using

<%= which_browser %>



Returns the version number of the browser being used

<%= which_browser_version%>



Returns the name of the platform the user is using

<%= which_platform %>



Nil is always returned if the data is unavailable

==== Example usage

An example below looks at the platform and outputs the right command to install this plugin

<% if which_platform? == 'Windows' -%>
	ruby script/plugin install http://svn.railslodge.com/svn/plugins/personalise_site/
<% elsif which_platform? == 'Mac' -%>
	./script/plugin install http://svn.railslodge.com/svn/plugins/personalise_site/
<% else -%>
	script/plugin install http://svn.railslodge.com/svn/plugins/personalise_site/
<% end -%>

0 comments

Please log in to leave a comment