Class: I18nDashboard::TranslationsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

i18n_dashboard_authenticate, i18n_dashboard_conf

Instance Method Details

#createObject



12
13
14
15
# File 'app/controllers/i18n_dashboard/translations_controller.rb', line 12

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

#destroyObject



17
18
19
20
# File 'app/controllers/i18n_dashboard/translations_controller.rb', line 17

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

#indexObject



8
9
10
# File 'app/controllers/i18n_dashboard/translations_controller.rb', line 8

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