Hi! I'm new to Rails and I'm trying to learn it using Rails 3 (RC).
I have managed to use http://plist.rubyforge.org/ for supporting the output of plists. I would like to check with you guys to see if my approach is the right way to do it. Here goes:
- In the gemfile I added
gem 'plist'
- In config/initializers/mime_types.rb I added
Mime::Type.register "application/plist", :plist
- In the controller, I added
format.plist { render :plist => @product }
inshow
- In the model, I added
def to_plist
attributes.to_plist
end - And finally, in the view file show.plist.erb, I have
<%= raw @product.to_plist %>
Accessing for instance /products/2.plist works fine, but being new to Rails, I'm wondering if there are anything I should have done differently.