October 20th, 2008 By: Daniel
Browsing the Rails API I found a few methods I wish I’d known about earlier.
current_page? in ActionView::Helpers::UrlHelper returns “true if the current request URI was generated by the given options.”
reverse_merge! in ActiveSupport::CoreExtensions::Hash::ReverseMerge “allows for reverse merging where its the keys in the calling hash that wins over those in the other_hash.”
So now instead of
I can do
And with ActiveSupport::CoreExtensions::String::Conversions I can stop using the PHP feeling
to the more rubyish
No comments:
Post a Comment