Acts As Taggable gem and MySQL duplicate key

I was using acts_as_taggable DHH’s plugin. But I have moved to gem based one. After changing my database scheme and making code changes I ran across issue. When I was updating routes with tags ActiveRecord have dumped following error: ActiveRecord::StatementInvalid (Mysql::Error: Duplicate entry ‘9’ for key 1: INSERT INTO routes_tags (`tag_id`, `id`, `route_id`) VALUES (9, […]

Helpers available both in controller and templates

With famous DRY, I have written a bunch of common checks from RNS to some helpers methods. And I have to find some way to access them both from templates (RHTML) and controllers. Rails provides two places to hold common helpers. First is app/controllers/application.rb, parent for all controllers. Methods defined in this class will be […]