views:

101

answers:

1

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:

  1. In the gemfile I added gem 'plist'
  2. In config/initializers/mime_types.rb I added Mime::Type.register "application/plist", :plist
  3. In the controller, I added format.plist { render :plist => @product } in show
  4. In the model, I added
    def to_plist
    attributes.to_plist
    end
  5. 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.

A: 

Looks right to me.

Jason Noble