Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/controllers/rails_admin/main_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_sort_hash(model_config)
end

def redirect_to_on_success
notice = t('admin.flash.successful', name: @model_config.label, action: t("admin.actions.#{@action.key}.done"))
notice = I18n.t('admin.flash.successful', name: @model_config.label, action: I18n.t("admin.actions.#{@action.key}.done"))
if params[:_add_another]
redirect_to new_path(return_to: params[:return_to]), flash: {success: notice}
elsif params[:_add_edit]
Expand Down Expand Up @@ -105,7 +105,7 @@ def sanitize_params_for!(action, model_config = @model_config, target_params = p
end

def handle_save_error(whereto = :new)
flash.now[:error] = t('admin.flash.error', name: @model_config.label, action: t("admin.actions.#{@action.key}.done").html_safe).html_safe
flash.now[:error] = I18n.t('admin.flash.error', name: @model_config.label, action: I18n.t("admin.actions.#{@action.key}.done").html_safe).html_safe
flash.now[:error] += %(<br>- #{@object.errors.full_messages.join('<br>- ')}).html_safe

respond_to do |format|
Expand All @@ -116,7 +116,7 @@ def handle_save_error(whereto = :new)

def check_for_cancel
return unless params[:_continue] || (params[:bulk_action] && !params[:bulk_ids])
redirect_to(back_or_index, notice: t('admin.flash.noaction'))
redirect_to(back_or_index, notice: I18n.t('admin.flash.noaction'))
end

def get_collection(model_config, scope, pagination)
Expand Down