ID + permalink. The id gets a to_i
1 2 3 4 5 6 7 8 9 |
# using .join def to_param [id, permalink].join('-') end # just another way to do it def to_param "#{id}-#{permalink}" end |
[ Last updated: August 09, 2007 @ 06:27 PM ]
1 Response to...
“Snippets: Rails to_param”
Sorry, comments are closed for this article.




using * to join
def to_param [id, permalink] * '-' end
;-)
Posted: September 28th, 2007 at 11:11 AM