Let me rephrase that.. :)
I want the column "game" in the Bets table to identify which match
I´ve chosen from the Matches table. The dropdown menu letting the user
choose which game, shall include the primary_key to all existing
matches. Or at least somehow identify a game.
Regards,
Martin Stabenfeldt
On 22/02/07, Martin Stabenfeldt
<martin-sCXqIeMX0Gf7tLni4+Tb9Q@public.gmane.org>
wrote:>
> Dear list,
>
> I got a database with two tables, ''bets'' and
''matches''.
> When placing a bet, I would like to have a [Match number] dropdown menu
listing the primary_key to all existing matches in the
''matches'' table.
> This connecting the bet to a known upcoming match.
>
> Would any of you gentlemen please give me some help?
>
>
> app/views/bets/new.rhtml:
>
> <% form_tag :action => ''create'' do %>
> <%= render :partial => ''form'' %>
> <%= submit_tag "Create" %>
> <% end %>
>
> <%= link_to ''Back'', :action =>
''list'' %>
>
>
> app/views/bets/_form.rhtml:
>
> <!--[form:bet]-->
> <p><label
for="bet_gambler">Gambler</label><br/>
> <%= text_field ''bet'',
''gambler'' %></p>
>
> <p><label
for="bet_game">Game</label><br/>
> <%= text_field ''bet'', ''game''
%></p>
>
> <p><label
for="bet_hjemme">Hjemme</label><br/>
> <%= text_field ''bet'',
''hjemme'' %></p>
>
> <p><label
for="bet_borte">Borte</label><br/>
> <%= text_field ''bet'',
''borte'' %></p>
>
>
> <p><label
for="bet_amount_of_money_placed">Amount of money
placed</label><br/>
> <%= text_field ''bet'',
''amount_of_money_placed'' %></p>
> <!--[eoform:bet]-->
>
>
> scheme.rb:
>
> create_table "bets", :force => true do |t|
> t.column "gambler", :string
> t.column "game", :integer
> t.column "hjemme", :integer
> t.column "borte", :integer
> t.column "bet_placed_at", :datetime
> t.column "amount_of_money_placed", :integer
> end
>
> create_table "matches", :force => true do |t|
> t.column "hjemmelag", :string
> t.column "bortelag", :string
> t.column "arena", :string
> t.column "date", :datetime
> t.column "goals_home", :decimal
> t.column "goals_away", :decimal
> end
>
> end
>
>
> All help is highly appreciated!
>
>
> Best regards,
> Martin Stabenfeldt
>
> >
>
--
Med vennlig hilsen,
Martin Stabenfeldt Mob: 93 44 17 07
A: Because it messes up the way people read text
Q: Why is top-posting such a bad thing?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---