wip save on blur
This commit is contained in:
parent
c7838debcf
commit
80216cb024
1 changed files with 19 additions and 4 deletions
|
|
@ -4,6 +4,9 @@
|
|||
|
||||
class ProfilesController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
respond_to :html
|
||||
respond_to :js, :only => :update
|
||||
def edit
|
||||
@person = current_user.person
|
||||
@aspect = :person_edit
|
||||
|
|
@ -37,16 +40,28 @@ class ProfilesController < ApplicationController
|
|||
if current_user.update_profile params[:profile]
|
||||
flash[:notice] = I18n.t 'profiles.update.updated'
|
||||
if current_user.getting_started?
|
||||
redirect_to getting_started_path
|
||||
respond_to do |format|
|
||||
format.js { render :nothing => true, :status => 200 }
|
||||
format.html { redirect_to getting_started_path }
|
||||
end
|
||||
else
|
||||
redirect_to edit_profile_path
|
||||
respond_to do |format|
|
||||
format.js { render :nothing => true, :status => 200 }
|
||||
format.html { redirect_to edit_profile_path }
|
||||
end
|
||||
end
|
||||
else
|
||||
flash[:error] = I18n.t 'profiles.update.failed'
|
||||
if params[:getting_started]
|
||||
redirect_to getting_started_path(:step => params[:getting_started])
|
||||
respond_to do |format|
|
||||
format.js { render :nothing => true, :status => 409 }
|
||||
format.html { redirect_to getting_started_path(:step => params[:getting_started]) }
|
||||
end
|
||||
else
|
||||
redirect_to edit_profile_path
|
||||
respond_to do |format|
|
||||
format.js { render :nothing => true, :status => 409 }
|
||||
format.html { redirect_to edit_profile_path }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue