title: How to allow users to create content without logging in (Rails, Devise)
body: <p>I'm creating a to-do list app and I want users to be able to create a list without logging in and only log in when they wish to save their list. Right now I'm using Devise, where I created a belongs_to association of the activity to the user. The save works if the user is logged in but not otherwise.</p>
  <p>How can I allow users to add activities to the activities index without having them being logged in and have the activities be deleted on refresh unless they log in and save them?</p>
  <p>Activities_Controller:</p>
  <pre><code>def create
      @activity = Activity.new(activity_params)
      authorize @activity
      if user_signed_in?
        @activity.user = current_user
        if @activity.save
          redirect_to activities_path
        else
          render :new
        end
      else
        @activity = Activity.new(activity_params)
        if @activity.save
          redirect_to activities_path
        else
          render :new
        end
      end
    end
  </code></pre>