if you create an aspect from the aspect manage page it redirects back there

This commit is contained in:
zhitomirskiyi 2010-11-25 16:18:39 -08:00
parent ef2fa21d06
commit 16d023e800

View file

@ -18,11 +18,14 @@ class AspectsController < ApplicationController
end
def create
puts "horray" if request.env['HTTP_REFERER']
@aspect = current_user.aspects.create(params[:aspect])
if @aspect.valid?
flash[:notice] = I18n.t('aspects.create.success', :name => @aspect.name)
if current_user.getting_started
redirect_to :back
elsif request.env['HTTP_REFERER'].includes("aspects/manage")
redirect_to :back
else
respond_with @aspect
end