Reputation: 69
I want some users to be able to download data in a yaml file.
I see that you can do this with
I followed this and tried something like def show @client = Client.find(params[:id])
respond_to do |format|
format.html
format.yml { render :yml => @client.redis_to_file }
end
end
redis_to_file returns a string with the yaml data
in config mime_types.rb
Mime::Type.register "x-yaml", :yml
then access like
clients/5.yml
All I get is "invalid template". (It's correct, I don't have a yml template in my views.)
Any clues about how to do this so that it works is greatly appreciated.
Upvotes: 4
Views: 564