I am learning rails and ruby and I have some questions about how
should I go
about doing certain things.
Many of my models have some functionality which is common, and
duplicating it across models, I want to store it in a single file, and
import the file into the models. Should I do this using modules, and
them in the `lib’ directory? What is the purpose of the tasks
the lib folder?
There is a similar repetition of functionality among the controllers, so
proper to create a new controller class containing the duplicated
and then inheriting my other controllers from this class? Or again use
to do so?
How can I provide an alternative name for a column in a model.
alias_method :new_column_name, :old_column_name provides a new name only
the reader method, I want this to be done for the writer also.
Thanks for your help.
Read the latest news at: http://news.kreeti.com
| “All animals are equal, but some animals are more equal than others.”
| – Orwell, Animal Farm, 1945