9 Comments

  1. muyiwaoyeniyi

    I removed my previous comment about having an error. I messed up the syntax.Now it really works like butter. Thanks a lot…many thanks.Taiwo

  2. utku

    I am getting ActiveModel::ForbiddenAttributesError when I did this.
    The error is in this line:
    # Save the pool
    @pool = current_user.pools.create(session[:pool][“pool”])
    .
    To resolve this I tried adding:
    private
    def pool_params
    params.require(:pool).permit(:title, :description, :user_id)
    end

    into pools controller and also application controller but same error just is there all the time :( What could be the reason and solution to this?

  3. utku

    i solved it :)
    the solution was this:
    new_attributes = session[:pool].require(:pool).permit(:title, :description)
    @pool = current_user.pools.create(new_attributes)

Leave a Reply

Your email address will not be published. Required fields are marked *