Sha256: b015e52d7667ae6a530edbf3e6341f8f32ab8a20af7ff383ba9ec68916e1330e

Contents?: true

Size: 677 Bytes

Versions: 7

Compression:

Stored size: 677 Bytes

Contents

require_dependency "lit/application_controller"

module Lit
  class LocalesController < ApplicationController
    def index
      @locales = Locale.ordered.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @locales }
      end
    end
    
    def hide
      @locale = Locale.find(params[:id])
      @locale.is_hidden = !@locale.is_hidden?
      @locale.save
      respond_to :js
    end
  
    def destroy
      @locale = Locale.find(params[:id])
      @locale.destroy
  
      respond_to do |format|
        format.html { redirect_to locales_url }
        format.json { head :no_content }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lit-0.2.4 app/controllers/lit/locales_controller.rb
lit-0.2.3 app/controllers/lit/locales_controller.rb
lit-0.2.2 app/controllers/lit/locales_controller.rb
lit-0.2.1 app/controllers/lit/locales_controller.rb
lit-0.2.0 app/controllers/lit/locales_controller.rb
lit-0.1.0 app/controllers/lit/locales_controller.rb
lit-0.0.4.3 app/controllers/lit/locales_controller.rb