I''m rending a form of a table in a partial. The rows can be adjusted dynamically. How do I write 1 2 3 4 5 ?? <%= render :partial => ''round'', :collection => @game.rounds %> <tr> <% fields_for_round(round) do |round_form| %> <td width="100%" align="center" class="<%= @class -%>"><%= ROW??? %></ td> <% end %> </tr> --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
if all you want is the count for the current partial being rendered you have it in round_counter http://ap.rubyonrails.com/classes/ActionView/Partials.html --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi. You''re rendering a form of a table in a partial. Tables don''t have forms. Do you mean a form for some data in a DATABASE table? That doesn''t make sense, either. perhaps you mean you''re rendering a form for a MODEL which is relying on data in a database table? If that''s the case, that''s fine. Now, you say the rows can be adjusted dynamically. Do you mean the rows can be adjusted by the user, when they''re looking at the page, using AJAX? Or do you mean they''re programmatically driven? what does: how do I write 1 2 3 4 5 .... mean? Do you mean how do I write the numbers from 1 to some arbitrary number? Or do you mean how do I label my rows, given a varying number of records to be displayed, or something else? BE MORE SPECIFIC! GET CLEAR! Do you understand why I''m being like this, now? Programming is a specific art, and you need to be very clear in your mind if you want to understand the reason things happen the way they do and fundamentally understand what processes are going on underneath "the hood" so to speak. I''m saying this because I care. Most people on this list will just look at your questions and treat them like rubbish, because it''s too hard to grok what you''re attempting to ask from your "Question". You can do this, I know you can - clearly write out your requirements for us so we can help you with them. Specify every little detail - exactly what you want to accomplish. Julian Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 10/04/2008, at 10:56 AM, edberner wrote:> > I''m rending a form of a table in a partial. The rows can be adjusted > dynamically. How do I write > 1 > 2 > 3 > 4 > 5 > ?? > > <%= render :partial => ''round'', :collection => @game.rounds %> > > > <tr> > <% fields_for_round(round) do |round_form| %> > <td width="100%" align="center" class="<%= @class -%>"><%= ROW??? > %></ > td> > <% end %> > </tr> > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Okay. I''ve got it now. You''ve been very helpful thanks. On Apr 9, 11:25 pm, Julian Leviston <jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote:> Hi. > > You''re rendering a form of a table in a partial. > > Tables don''t have forms. > > Do you mean a form for some data in a DATABASE table? > > That doesn''t make sense, either. > > perhaps you mean you''re rendering a form for a MODEL which is relying > on data in a database table? > > If that''s the case, that''s fine. > > Now, you say the rows can be adjusted dynamically. > > Do you mean the rows can be adjusted by the user, when they''re looking > at the page, using AJAX? > > Or do you mean they''re programmatically driven? > > what does: how do I write 1 2 3 4 5 .... mean? > > Do you mean how do I write the numbers from 1 to some arbitrary number? > > Or do you mean how do I label my rows, given a varying number of > records to be displayed, or something else? > > BE MORE SPECIFIC! GET CLEAR! > > Do you understand why I''m being like this, now? > > Programming is a specific art, and you need to be very clear in your > mind if you want to understand the reason things happen the way they > do and fundamentally understand what processes are going on underneath > "the hood" so to speak. > > I''m saying this because I care. Most people on this list will just > look at your questions and treat them like rubbish, because it''s too > hard to grok what you''re attempting to ask from your "Question". > > You can do this, I know you can - clearly write out your requirements > for us so we can help you with them. Specify every little detail - > exactly what you want to accomplish. > > Julian > > Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) > VIDEO #3 out NOW!http://sensei.zenunit.com/ > > On 10/04/2008, at 10:56 AM, edberner wrote: > > > > > I''m rending a form of a table in a partial. The rows can be adjusted > > dynamically. How do I write > > 1 > > 2 > > 3 > > 4 > > 5 > > ?? > > > <%= render :partial => ''round'', :collection => @game.rounds %> > > > <tr> > > <% fields_for_round(round) do |round_form| %> > > <td width="100%" align="center" class="<%= @class -%>"><%= ROW??? > > %></ > > td> > > <% end %> > > </tr>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Actually I was asking these questions to gather responses from you so we can further help... If you respond to the questions, then we can potentially get to the bottom of solving your issue(s). Sorry if I''m coming across as narky. I think I need more sleep, and less coffee. Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 10/04/2008, at 1:51 PM, edberner wrote:> > Okay. I''ve got it now. You''ve been very helpful thanks. > > On Apr 9, 11:25 pm, Julian Leviston <jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote: >> Hi. >> >> You''re rendering a form of a table in a partial. >> >> Tables don''t have forms. >> >> Do you mean a form for some data in a DATABASE table? >> >> That doesn''t make sense, either. >> >> perhaps you mean you''re rendering a form for a MODEL which is relying >> on data in a database table? >> >> If that''s the case, that''s fine. >> >> Now, you say the rows can be adjusted dynamically. >> >> Do you mean the rows can be adjusted by the user, when they''re >> looking >> at the page, using AJAX? >> >> Or do you mean they''re programmatically driven? >> >> what does: how do I write 1 2 3 4 5 .... mean? >> >> Do you mean how do I write the numbers from 1 to some arbitrary >> number? >> >> Or do you mean how do I label my rows, given a varying number of >> records to be displayed, or something else? >> >> BE MORE SPECIFIC! GET CLEAR! >> >> Do you understand why I''m being like this, now? >> >> Programming is a specific art, and you need to be very clear in your >> mind if you want to understand the reason things happen the way they >> do and fundamentally understand what processes are going on >> underneath >> "the hood" so to speak. >> >> I''m saying this because I care. Most people on this list will just >> look at your questions and treat them like rubbish, because it''s too >> hard to grok what you''re attempting to ask from your "Question". >> >> You can do this, I know you can - clearly write out your requirements >> for us so we can help you with them. Specify every little detail - >> exactly what you want to accomplish. >> >> Julian >> >> Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) >> VIDEO #3 out NOW!http://sensei.zenunit.com/ >> >> On 10/04/2008, at 10:56 AM, edberner wrote: >> >> >> >>> I''m rending a form of a table in a partial. The rows can be adjusted >>> dynamically. How do I write >>> 1 >>> 2 >>> 3 >>> 4 >>> 5 >>> ?? >> >>> <%= render :partial => ''round'', :collection => @game.rounds %> >> >>> <tr> >>> <% fields_for_round(round) do |round_form| %> >>> <td width="100%" align="center" class="<%= @class -%>"><%= ROW??? >>> %></ >>> td> >>> <% end %> >>> </tr> > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
<h2>edit game</h2> <% form_for :game, :url => school_team_game_url(School.find(current_user.school_id), Team.find_by_user_id(current_user), @game), :html => { :method => ''put'' } do |f| %> <%= render :partial => ''fields'', :locals => { :f => f } %> <p><%= submit_tag "Submit Game" %></p> <% end %> </div> ... <%= render :partial => ''round'', :collection => @game.rounds %> ... <tr> <% fields_for_round(round) do |round_form| %> <% @class = cycle("", "alt", :name => "colors") -%> <% 3.times do |p| %> <td class="<%= @class -%>"><%= round_form.select(:action, ["Miss", "Skip", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]) %> <%= round_form.hidden_field :player_id, :value => Team.find_by_user_id(current_user).players[p].id %></td> #<%= round_form.hidden_field :row_id, :value => round_counter + 1 %></ td> #it keeps repeating 2 every time i hit Add Round. It needs to keep counting up! <% end %> <td width="100%" align="center" class="<%= @class -%>"><%= round_counter + 1 %></td> <% 3.times do |p| %> <td class="<%= @class -%>"><%= round_form.select(:action, ["Miss", "Skip", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]) %> <%= round_form.hidden_field :player_id, :value => Team.find_by_user_id(current_user).players[p].id %></td> <% end %> <% end %> </tr> On Apr 10, 2008, at 12:47 AM, Julian Leviston wrote:> > Actually I was asking these questions to gather responses from you so > we can further help... > > If you respond to the questions, then we can potentially get to the > bottom of solving your issue(s). > > Sorry if I''m coming across as narky. I think I need more sleep, and > less coffee. > > Julian. > > Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) > VIDEO #3 out NOW! > http://sensei.zenunit.com/ > > > On 10/04/2008, at 1:51 PM, edberner wrote: > >> >> Okay. I''ve got it now. You''ve been very helpful thanks. >> >> On Apr 9, 11:25 pm, Julian Leviston <jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote: >>> Hi. >>> >>> You''re rendering a form of a table in a partial. >>> >>> Tables don''t have forms. >>> >>> Do you mean a form for some data in a DATABASE table? >>> >>> That doesn''t make sense, either. >>> >>> perhaps you mean you''re rendering a form for a MODEL which is >>> relying >>> on data in a database table? >>> >>> If that''s the case, that''s fine. >>> >>> Now, you say the rows can be adjusted dynamically. >>> >>> Do you mean the rows can be adjusted by the user, when they''re >>> looking >>> at the page, using AJAX? >>> >>> Or do you mean they''re programmatically driven? >>> >>> what does: how do I write 1 2 3 4 5 .... mean? >>> >>> Do you mean how do I write the numbers from 1 to some arbitrary >>> number? >>> >>> Or do you mean how do I label my rows, given a varying number of >>> records to be displayed, or something else? >>> >>> BE MORE SPECIFIC! GET CLEAR! >>> >>> Do you understand why I''m being like this, now? >>> >>> Programming is a specific art, and you need to be very clear in your >>> mind if you want to understand the reason things happen the way they >>> do and fundamentally understand what processes are going on >>> underneath >>> "the hood" so to speak. >>> >>> I''m saying this because I care. Most people on this list will just >>> look at your questions and treat them like rubbish, because it''s too >>> hard to grok what you''re attempting to ask from your "Question". >>> >>> You can do this, I know you can - clearly write out your >>> requirements >>> for us so we can help you with them. Specify every little detail - >>> exactly what you want to accomplish. >>> >>> Julian >>> >>> Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) >>> VIDEO #3 out NOW!http://sensei.zenunit.com/ >>> >>> On 10/04/2008, at 10:56 AM, edberner wrote: >>> >>> >>> >>>> I''m rending a form of a table in a partial. The rows can be >>>> adjusted >>>> dynamically. How do I write >>>> 1 >>>> 2 >>>> 3 >>>> 4 >>>> 5 >>>> ?? >>> >>>> <%= render :partial => ''round'', :collection => @game.rounds %> >>> >>>> <tr> >>>> <% fields_for_round(round) do |round_form| %> >>>> <td width="100%" align="center" class="<%= @class -%>"><%= ROW??? >>>> %></ >>>> td> >>>> <% end %> >>>> </tr> >>> > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---