Created
June 24, 2009 13:46
-
-
Save jtadeulopes/135272 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/quina.rb | |
class Quina | |
def self.gerar_numeros | |
resultado = (1..8).map { (1..10).map } | |
end | |
end | |
# app/controllers/quina_controller.rb | |
class QuinaController < ApplicationController | |
def index | |
@quina = Quina.gerar_numeros | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/views/quina/index.html.erb | |
<table> | |
<% @quina.each do |linha| %> | |
<tr> | |
<% linha.each do |coluna| %> | |
<td><%= "Coluna #{coluna}" %></td> | |
<% end %> | |
</tr> | |
<% end %> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment