Permalink
Browse files

Allow downloading yml file from tolk interface

  • Loading branch information...
1 parent 5e65a74 commit 94008c2e169c6dc5355bfdbfd42096293db47b20 @lifo lifo committed Apr 8, 2010
Showing with 7 additions and 10 deletions.
  1. +4 −5 app/controllers/tolk/locales_controller.rb
  2. +1 −5 config/initializers/mime_types.rb
  3. +2 −0 init.rb
@@ -1,17 +1,16 @@
module Tolk
class LocalesController < ApplicationController
before_filter :find_locale, :only => [:show, :all, :update]
- before_filter :ensure_no_primary_locale, :only => [:all, :update]
+ before_filter :ensure_no_primary_locale, :only => [:all, :update, :show]
def index
@locales = Tolk::Locale.secondary_locales
end
def show
- if @locale.primary?
- render :primary_locale
- else
- @phrases = @locale.phrases_without_translation(params[:page])
+ respond_to do |format|
+ format.html { @phrases = @locale.phrases_without_translation(params[:page]) }
+ format.yml { render :text => @locale.to_hash.to_yaml }
end
end
@@ -1,5 +1 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new mime types for use in respond_to blocks:
-# Mime::Type.register "text/richtext", :rtf
-# Mime::Type.register_alias "text/html", :iphone
+Mime::Type.register_alias "text/yaml", :yml
View
@@ -1,2 +1,4 @@
+Mime::Type.register_alias "text/yaml", :yml
+
gem 'will_paginate', '~> 2.3.12'
require 'will_paginate'

0 comments on commit 94008c2

Please sign in to comment.