-
- def update
- @ground_picture = GroundPicture.show(params[:id], @author)
- @ground_picture.attributes = params[:ground_picture]
- @panel = Panel.edit(@ground_picture.panel.id, @author)
- @ground_picture.overwrite @panel.id
-
- @picture = Picture.show @ground_picture.picture_id, @author
- raise ActiveRecord::Forbidden unless @picture.enable?
-
- respond_to do |format|
- if @ground_picture.store @author
- flash[:notice] = I18n.t('flash.notice.updated', :model => GroundPicture.model_name.human)
- format.html { redirect_to @ground_picture }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_updated', :model => GroundPicture.model_name.human)
- format.html { render action: "edit" }
- format.json { render json: @ground_picture.errors, status: :unprocessable_entity }
- end
- end