Class: I18nDashboard::TranslationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/i18n_dashboard/translations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
# File 'app/controllers/i18n_dashboard/translations_controller.rb', line 10

def create
  Translation.create(params[:key], params[:value], params[:locale])
  redirect_to root_path, :notice => "Added translations"
end

#destroyObject



15
16
17
18
# File 'app/controllers/i18n_dashboard/translations_controller.rb', line 15

def destroy
  Translation.destroy(params[:id])
  redirect_to root_path, :notice => "Key deleted"
end

#indexObject



6
7
8
# File 'app/controllers/i18n_dashboard/translations_controller.rb', line 6

def index
   @translations = Translation.all(params[:query])
end