I guess you want to redirect after your create action, which is executed when the form is submitted.
Just add redirect_to in the following way:
def create
@invite = Invite.new(params[:invite])
if @invite.save
...
redirect_to '/thanks'
else
...
redirect_to new_invite_path # if you want to return to the form submission page on error
end
end
I omitted some of the code for brevity.
In your routes add:
get '/thanks', to: "invites#thanks"
Add the thanks action to your invites controller:
def thanks
# something here if needed
end
And create a thanks.html.erb page in app/views/invites.