Ruby On Rails Category

Finally the long waiting rails 2.2 is released.
Referring to riding rails latest blog post , rails 2.2.2 released at November 21, 2008.
As we have tried the 2.2.1 version, i have solved rubygems upgrade problem. for rubygems 1.1 or 1.2 folks you may try :
$ gem install rubygems-update (again, might need to be admin/root)
$ update_rubygems [...]

HACKs on acts_as_audited plugin

In: Ruby On Rails

Audit Trail
At many cases, we have a use case called “Please keep all changes as history, showing who had created, or updated such record and log the time s/he did that” — This is a typical audit trail task in a very common system.
“Tommy created Products at 2008-08-20″ and “Thomas updated Orders at 2008-08-30 with [...]

Acts As Taggable On Steroids is based on acts_as_taggable by DHH but includes extras such as
tests, smarter tag assignment, and tag cloud calculations.
For a number of applications, especially our Tutor Social Platform - Tutor Metro,  We’ve found a need for advanced tagging functionality not offered by the acts_as_taggable_on_steroids plugin.
for instance, we will wished a model [...]

“Awesome” Nested Set

In: Ruby On Rails

During the development of our latest product, we have to store a set of data in a tree structure. Usually we would implement the tree in nested set, if we found that we usually fetch the tree but not update the tree. Nested Set structure would have a bigger overhead if we do update on [...]

TutorMetro.com is on alpha

In: Project, Ruby On Rails

After a session of development, our web site www.tutormetro.com is finally out in alpha release.
TutorMetro.com got an internal project code: pilot, which is aimed at providing a free tuition referral platform to local market.「名師」is the Chinese Name of tutormetro.com which represent the high quality of the tutors listed in the site.
TutorMetro.com is built solely on [...]

BDD Behaviour Driven Development

In: Ruby On Rails

In Hong Kong, as a fast moving city, “urgent” is one of the most common requirement from the clients. They require the most “cost-effective” way to implement systems and with a marginal price. For these low budget (but urgent) projects, some of the local software houses would simply deliver a “just-to-requirement” and “not-well-tested” solution to [...]

Tutormetro uses Google Apps For Your Domain, and all email flows throw Google’s servers. Unfortunately, Rails 1.2.2 or later cannot send via smtp.google.com out of the box as it use tls, which standard ruby package is not included.
There is a solution from http://railsforum.com/viewtopic.php?id=12875 .We have deployed and tested in our Pilot site. Here are the [...]

Ferret’s analyzer perform terribly support for multilingual .
thanks for the plugin multilingual_ferret_tools
Here is the description from it:

This plugin provides a multilingual-aware Analyzer for Ferret. This analyzer is useful when
fields may contain characters from multiple languages. Fields are broken into latin parts and
non-latin-parts- the latin parts are then processed with Ferret::Analysis::StandardAnalyzer, and
the non-latin [...]

gem dependencies in 2.1.0

In: Ruby On Rails

In Rails 2.1 we now have the ability to set gem dependencies.
to config, we can add config.gem in config/environment.rb
When I try to add
config.gem “RedCloth”
config.gem “mime-types”
it throw RedCloth and mime-types error .seems it cannot detect the gems library and always execute gem install .
no such file to load — RedCloth
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/gem_dependency.rb:57:in `load’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/symbol.rb:11:in [...]

Customize Will Paginate Layout

In: Ruby On Rails

Customize Will Paginate Layout
In Rails 2.0 , the paginate is removed and we start looking into will_paginate for pagination display.
reference:
http://iceskysl.1sters.com/?action=show&id=42
http://rock.errtheblog.com/will_paginate/classes/WillPaginate/ViewHelpers.html
here is our code
<%= page_entries_info @tutor %>
<%- paginated_section @tutor do %>
… display tutor info..
<%- end%>
display would be :

Displaying entries 1-2 of 2 in total
<div class=”pagination“>

<span class=”disabled prev_page“>上一頁</span>

<span class=”current“>1</span>

<a rel=”next“ href=”/tutors/tags/%E7%89%A9%E7%90%86?page=2“>2</a>

<a class=”next_page“ rel=”next“ href=”/tutors/tags/%E7%89%A9%E7%90%86?page=2“>下一頁</a>

</div>

however if we would [...]