PHP Headers for Sending CSV File Downloads
If you would like to force a file download prompt to the user, instead of just outputting the text to the browser, use the following headers.
Get Method Name as String in Python
Here is how to get the string representation of a method in Python
print "Hello World"
# => 'my_method_name'
Short and sweet!
Aliasing Attributes in Ruby on Rails
Alias an attribute with alias_attribute method.
The first argument is the name for the new attribute, while the second argument is to identify the attribute that is already defined.
class User < ActiveRecord::Base
alias_attribute :username, :login
Renaming Routes in Rails 3 with :As and :Controller
Renaming routes in Rails 2.* is straight forward. It goes something like this.
map.resources :users, :as => :members
This will give you users_path and form_for(User.new) helpers, for instance, mapping the url to /members instead of ...