mercredi 15 juillet 2020

Transforming text to bold in ruby

I have both controller and view for a simple game I've created.

This is my function :

def score
    @letters = params[:letters]
    @word = params[:word].upcase
    if !compsrison?(@word.split(''), @letters.split)
      @result = "Sorry, but #{@word} can't be build out of **#{@letters}**"
    elsif !check_api?(@word)
      @result = "Sorry, but **#{@word}** doesn't seem to be valid English word..."
    else
      @result = "Congratulations! **#{@word}** is a valid English word!"
    end
  end

and simply my view for a result :

 <div class="result">
    <%= @result %>
  </div>

I would like my params[:word] and params[:letters] to be a bold text looking sth like that:1

I can't seem to find the build-in method in ruby for a bold text or change it in my erb file.

thanks!

Aucun commentaire:

Enregistrer un commentaire