I am using Rails 4 and Bootstrap 3 to build a CRUD web app.

I have an Invite model that lets users invite other users to join the app — and this is currently working.

This is my `InvitesController`:

```
class InvitesController < ApplicationController
  def create
    # some code
    if @invite.save
      # some code
      redirect_to some_path, notice: 'Invitation was successfully sent.'
    else
      redirect_to another_path, alert: 'Invitation could not be sent: please make sure you enter a valid email address and choose a role.'
    end
  end

end

```

Now, when a user successfully sends an invite, he is redirected to some path and gets a ***blue*** `notice` telling him precisely that.

However, when a user does not fill the Invite form correctly and the invite cannot be sent successfully, he is redirected to the same view (where the form is) and gets a ***yellow*** `alert` telling him there was an error in his form.

I would like to make the latter a ***red*** `alert` and I thought Bootstrap would allow me to do so by using `redirect_to another_path, error: 'Invitation could not be sent: please make sure you enter a valid email address and choose a role.'`

This did not work.

–––––

**UPDATE**: What I am looking for here is a way to use the `.alert-danger` Bootstrap alert class, I don't want to simply change the color of my alert from yellow to red.

–––––

What is the Rails / Bootstrap way of achieving what I need?