August 2011
3 posts
Rails 3.1 custom serialize
A new feature that really makes our lives easier is the custom serialize option. Let’s say that your DB requires that when you save a serializable attribute to be in a CSV form instead of the YAML default.
If this is the case then you could use the following
class CommaSeparatedList
def load(text)
return unless text
text.split(",")
end
def dump(text)
...
Rails 3.1 asset pipeline
When you’re trying out the new asset pipeline it might will be hard to debug any CSS/JS since it will all be compressed in to one file.
When you use the link/include tag remember to add the next parameter
stylesheet_link_tag :admin, :debug => Rails.env.development?
javascript_include_tag :admin, :debug => Rails.env.development?
This way it will only server the files separately...
Installing Rails 3.1 --pre on OSX Lion
After trying several ways of doing
gem install rails --pre
and still getting errors, I found the following to do the trick
rvm gemset rails --pre
It will save you a couple of hours.