Class: Workarea::Admin::RecommendationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/admin/recommendations_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #find_sort, #wrap_in_view_model, wrap_in_view_model

Methods included from Publishing

#allow_publishing!, #allow_publishing?, #set_publishing_options

Methods included from Visiting

#most_visited

Instance Method Details

#editObject



9
10
# File 'app/controllers/workarea/admin/recommendations_controller.rb', line 9

def edit
end

#updateObject



12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/workarea/admin/recommendations_controller.rb', line 12

def update
  @settings.sources = params[:sources].uniq if params[:sources].present?
  if @settings.update_attributes(params[:settings])
    flash[:success] = t('workarea.admin.recommendations.flash_messages.saved')
    redirect_to catalog_product_path(@product)
  else
    flash[:error] = t('workarea.admin.recommendations.flash_messages.changes_error')
    render :edit
  end
end