Sha256: 858d8c35b9181ba7e164dd959356931c590a619f53f0beca3468d81f1006bb02

Contents?: true

Size: 620 Bytes

Versions: 108

Compression:

Stored size: 620 Bytes

Contents

class Wco::ProfilesController < Wco::ApplicationController

  def update
    @profile = Wco::Profile.find params[:id]
    authorize! :update, @profile

    # if params[:photo]
    #   photo = Photo.new :photo => params[:photo]
    #   @profile.profile_photo = photo
    # end

    flag = @profile.update params[:profile].permit!
    if flag
      flash_notice "Updated profile #{@profile.email}"
    else
      flash_alert "Cannot update profile: #{@profile.errors.full_messages}"
    end
    if params[:redirect_to]
      redirect_to params[:redirect_to]
    else
      redirect_to request.referrer
    end
  end

end

Version data entries

108 entries across 108 versions & 1 rubygems

Version Path
wco_models-3.1.0.147 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.146 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.145 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.144 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.143 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.142 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.141 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.140 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.139 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.138 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.137 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.136 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.135 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.134 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.133 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.132 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.131 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.130 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.129 app/controllers/wco/profiles_controller.rb
wco_models-3.1.0.128 app/controllers/wco/profiles_controller.rb