okay lol forget about the "nil" problem I mentioned at the end, that was 
because out of the huge list of words there were a few that started with 
a symbol other than a kanji so just doing:

"k.id unless k.nil?" did the trick

so I'm going to change my question to... is there another(simpler) way 
to do this? right now my helper looks like crap, I mean... like this:

*************************************
  def word_to_links(word)
    parts, o = [], ""
    (word.size/3).times{ |i| parts << word[i*3,3] }
    parts.each do |part|
      k = Kanji.find(:first, :conditions => "kanjis.kanji = '#{part}'")
      o << (k.nil? ? part : link_to(part, "/kanjis/#{k.id}"))
    end
    o
  end
*************************************

Thanks.
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to