Tag: Rails

  • Rethinking Routes

    Geoffrey Grosenbach is wondering how to bring the URL back into Rails: This epiphany came while writing a few Sinatra applications. The exact URL for a handler sits right in front of my eyes as I write the code for it. I can’t ignore it. … In contrast, you can write an entire Rails application…

  • Custom time descriptions in Rails

    From the helpful dudes at Thoughtbot: thanks to the new internationalization framework in Rails 2.2 and later, ends up you can easily override the text used by relative date/time helpers like time_ago_in_words by just adding some lines to your locales/en.yml file. Good to know!

  • Pleased to Meet You, Won’t You Guess My Name?

    While working on a little Rails project this week, I discovered something very interesting (and little-documented) in ActiveSupport: Module.model_name. It's a core extension to support Rails's handling of models as RESTful resources, as in the examples below: # BlogPost is a subclass of ActiveRecord::Base @blog_post = BlogPost.find(108) # Same as render “blog_posts/blog_post”, :object => @blog_post…