if you create an aspect from the aspect manage page it redirects back there
This commit is contained in:
parent
ef2fa21d06
commit
16d023e800
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue