Sha256: 504f5fd079581e6cd44531dd2ac9c9d1a96b7328cb44cebf1e54719ec24f1c09

Contents?: true

Size: 1.16 KB

Versions: 60

Compression:

Stored size: 1.16 KB

Contents

class Backend::SearchSynonymsController < Backend::BaseController
  include Concerns::PaginationController

  before_action -> { breadcrumb.add t('b.search_synonyms'), backend_search_synonyms_path }
  before_action :find_model, only: [:edit, :update, :destroy]

  def index
    @search_synonyms = paginate(SearchSynonym.all)
  end

  def new
    @search_synonym = SearchSynonym.new
  end

  def create
    @search_synonym = SearchSynonym.new(allowed_params)

    if @search_synonym.save
      redirect_to backend_search_synonyms_path, notice: translate_notice(:added, :search_synonym)
    else
      render :new
    end
  end

  def destroy
    @search_synonym.destroy
    redirect_to backend_search_synonyms_path, notice: translate_notice(:deleted, :search_synonym)
  end

  def update
    if @search_synonym.update_attributes allowed_params
      redirect_to backend_search_synonyms_path, notice: translate_notice(:edited, :search_synonym)
    else
      render :edit
    end
  end

  private

  def allowed_params
    params.require(:search_synonym).permit(
      :locale, :term, :synonyms
    )
  end

  def find_model
    @search_synonym = SearchSynonym.find(params[:id].to_i)
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
udongo-7.9.0 app/controllers/backend/search_synonyms_controller.rb
udongo-7.8.1 app/controllers/backend/search_synonyms_controller.rb
udongo-7.8.0 app/controllers/backend/search_synonyms_controller.rb
udongo-7.7.2 app/controllers/backend/search_synonyms_controller.rb
udongo-7.7.1 app/controllers/backend/search_synonyms_controller.rb
udongo-7.7.0 app/controllers/backend/search_synonyms_controller.rb
udongo-7.6.2 app/controllers/backend/search_synonyms_controller.rb
udongo-7.6.1 app/controllers/backend/search_synonyms_controller.rb
udongo-7.6.0 app/controllers/backend/search_synonyms_controller.rb
udongo-7.5.1 app/controllers/backend/search_synonyms_controller.rb
udongo-7.5.0 app/controllers/backend/search_synonyms_controller.rb
udongo-7.4.2 app/controllers/backend/search_synonyms_controller.rb
udongo-7.4.1 app/controllers/backend/search_synonyms_controller.rb
udongo-7.4.0 app/controllers/backend/search_synonyms_controller.rb
udongo-7.3.5 app/controllers/backend/search_synonyms_controller.rb
udongo-7.3.4 app/controllers/backend/search_synonyms_controller.rb
udongo-7.3.3 app/controllers/backend/search_synonyms_controller.rb
udongo-7.3.2 app/controllers/backend/search_synonyms_controller.rb
udongo-7.3.1 app/controllers/backend/search_synonyms_controller.rb
udongo-7.2.1 app/controllers/backend/search_synonyms_controller.rb