```ruby
class WelcomeController < ApplicationController
  def index
    @questions = Question.all.order('created_at DESC')
  end

  def show

  end
end```

Add search method in welcome controller.
user
```ruby
class WelcomeController < ApplicationController
  def index
    @questions = Question.all.order('created_at DESC')
  end

  def show

  end

  def search
    @questions = Question.search(params[:words])
    render 'index'
  end
end```
assistant