```ruby
class MainController < ApplicationController
  def index
  	@components = Component.all.is_approved.by_age.reverse
    @prompt = Prompt.last

  end
end
```

Add a default Prompt in order to not break the database if there aren't any prompts
user
```ruby
class MainController < ApplicationController
  def index
  	@components = Component.all.is_approved.by_age.reverse
    @prompt = Prompt.last || Prompt.create(content: "What is a fun date idea?")

  end
end
```
assistant