xaviershay / enki

A Ruby on Rails blogging app for the fashionable developer. It's better than Mephisto or SimpleLog
Other
818 stars 274 forks source link

Dot character in tag name #93

Closed gaelian closed 11 years ago

gaelian commented 11 years ago

Here's a funny one: on my blog, I happen to have a tag named "gov-2.0", since upgrading my blog recently I started noticing an exception being generated by crawlers visiting my site and hitting the address for my "gov-2.0" tag:

A ActionController::UnknownFormat occurred in posts#index:

  ActionController::UnknownFormat
  app/controllers/posts_controller.rb:6:in `index'

And...

Parameters: {"controller"=>"posts", "action"=>"index", "tag"=>"gov-2", "format"=>"0"}

So the dot is being considered as the format specifier and ".0" is not surprisingly an unknown format. :) One potential fix for this might be something like what this guy is talking about:

http://legacy.x3ro.de/rails-3-routing-parameters-dots/

That "gov-2.0" tag has been on my site for quite some time, I don't remember having this problem previously. I guess something has changed with Rails recently? Not exactly sure when.

I'll be fixing this for myself no doubt, but is this something to fix on master? is the above link an acceptable approach?

xaviershay commented 11 years ago

Yeah that fix looks good. PR would be amazing!