title: Rails: Can you pass arguments to the after_create method?
body: <p>In my application, only users with the administrator role may create new users. In the new user form, I have a select box for each of the available roles that may be assigned to new users.</p>
  
  <p>I am hoping to use the after_create callback method to assign the role to the user. How can I access the selected value of the select box in the after_create method?</p>
  
  <pre><code>  def create
      @user = User.new(params[:user])
  
      respond_to do |format|
        if @user.save
          flash[:notice] = 'User creation successful.'
          format.html { redirect_to @user }
        else
          format.html { render :action =&gt; 'new' }
        end
      end
    end
  </code></pre>
  
  <p>In the user model I have:</p>
  
  <pre><code>  after_create :assign_roles
  
    def assign_roles
      self.has_role! 'owner', self
      # self.has_role! params[:role]
    end
  </code></pre>
  
  <p>I receive an error because the model doesn't know what role is.</p>