Method: FacetsController#update

Defined in:
app/controllers/facets_controller.rb

#updateObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/controllers/facets_controller.rb', line 25

def update
  if params[:facet][:caption].blank?
    flash[:error] = "Facet could not be updated! Caption cannot be empty"
    redirect_to :back
    return
  end
  @facet = @catalog.facets.find(params[:id])
  if @facet.update_attributes(params[:facet])
    flash[:notice] = "Facet has been updated."
    redirect_to  edit_catalog_facet_path(@catalog, @facet)
  else
    render :action => 'edit'
  end
end