skip_authorization_check :only => [:new], :if => current_user.profile.nil?
i need something like this to work.
If current user doesn't have any profile then we need to give him rights to create one profile then after he doesn't has the ability to another profile. Means we need to skip authorization for first time.
Please help me out friends.
you probably solved this one already, but ryan provided here nice way to do this kinda things, if i am gettin you right.. and I use that also... the gist of it is to do thing such as this:
in your ability.rb do
user ||= User.new
can :manage, :all
# put here can for the User.new or something
this way if noone is signed in still a new "anonym" user is created and you can determine that is not registered, so you can let him do that :) hope it helped you