title: Why isn't my flash[:alert] working?
body: <p>after my user uploads a file and hits "submit" i would like to alert them that the upload was successful. But nothing happens when I do.</p>
  
  <p>Here is in the controller:</p>
  
  <pre><code>def create
      # make a new picture with what picture_params returns (which is a method we're calling)
      @picture = Picture.new(picture_params)
      if @picture.save
        # if the save for the picture was successful, go to index.html.erb
        redirect_to pictures_url
        flash[:alert] = "Upload successful!"
      else
        # otherwise render the view associated with the action :new (i.e. new.html.erb)
        render :new
      end
    end
  </code></pre>
  
  <p>Form:</p>
  
  <pre><code>&lt;container&gt;
  &lt;center&gt;
  &lt;%= form_for @picture do |f| %&gt;
    &lt;input type="file" multiple&gt;  &lt;%= f.file_field :picture %&gt;
    &lt;p&gt;Drag your files here or click in this area.&lt;/p&gt;
    &lt;button type="submit"&gt; &lt;%= f.submit "Save" %&gt; Upload &lt;/button&gt;
    &lt;% if flash[:alert] %&gt;
      &lt;div class="alert"&gt;&lt;%= flash[:alert] %&gt;&lt;/div&gt;
    &lt;% end %&gt;
  &lt;/form&gt;
  &lt;% end %&gt;
  &lt;/container&gt;
  </code></pre>
  
  <p>Thanks!</p>