Okay I got ther error below in figure-1, so I added an end then I got figure-2 figure-1 expecting tCOLON2 or ''['' or ''.'' figure-2 unexpected '';'', expecting tCOLON2 or ''['' or ''.'' end ; _erbout -- Posted via http://www.ruby-forum.com/.
Mohammad wrote:> Okay I got ther error below in figure-1, so I added an end then I got > figure-2 > figure-1 > expecting tCOLON2 or ''['' or ''.'' > figure-2 > unexpected '';'', expecting tCOLON2 or ''['' or ''.'' > end ; _erbout >This rather unhelpful error message indicates that you''ve got a syntax error somewhere. You''ll just have to track it down. Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
<h1>Panel for <%= @user.login %></h1> <h3>Army</h3> <% for @army_types.each do |running| %> <% if @user.running != nil %> <%= @army_names[@cell1] %>: <%= @user.running %><br> <% end %> <% @cell1 += 1 %> <% end %> thats the code -- Posted via http://www.ruby-forum.com/.
> -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Mohammad > Sent: Monday, May 08, 2006 1:11 PM > To: rails@lists.rubyonrails.org > Subject: [Rails] Re: Unexpected, Expected> <% for @army_types.each do |running| %>Here''s the problem. It''s either "for x in @list" or "@list.each", not "for x in @list.each". Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Mohammad wrote:> <h1>Panel for <%= @user.login %></h1> > <h3>Army</h3> > <% for @army_types.each do |running| %> > <% if @user.running != nil %> > <%= @army_names[@cell1] %>: <%= @user.running %><br> > <% end %> > <% @cell1 += 1 %> > <% end %> > thats the code >Check your .each line. -- Alex
Alex Young wrote:> Mohammad wrote: >> <h1>Panel for <%= @user.login %></h1> >> <h3>Army</h3> >> <% for @army_types.each do |running| %> >> <% if @user.running != nil %> >> <%= @army_names[@cell1] %>: <%= @user.running %><br> >> <% end %> >> <% @cell1 += 1 %> >> <% end %> >> thats the code >> > Check your .each line.thats not the error, I really want to know whats going down, this has been staling me for weeks now -- Posted via http://www.ruby-forum.com/.
>>> <h1>Panel for <%= @user.login %></h1> >>> <h3>Army</h3> >>> <% @army_types.each do |running| %> >>> <% if @user.running != nil %> >>> <%= @army_names[@cell1] %>: <%= @user.running %><br> >>> <% end %> >>> <% @cell1 += 1 %> >>> <% end %> >>> thats the code >>>it''s the "for" above is the code now but, I can''t do @user.running is there a way to do somthing like that? -- Posted via http://www.ruby-forum.com/.
Mohammad wrote:> Alex Young wrote: > >>Mohammad wrote: >> >>><h1>Panel for <%= @user.login %></h1> >>><h3>Army</h3> >>><% for @army_types.each do |running| %> >>><% if @user.running != nil %> >>><%= @army_names[@cell1] %>: <%= @user.running %><br> >>><% end %> >>><% @cell1 += 1 %> >>><% end %> >>>thats the code >>> >> >>Check your .each line. > > thats not the error, I really want to know whats going down, this has > been staling me for weeks nowCheck it again. irb(main):001:0> l = [1,2,3] => [1, 2, 3] irb(main):002:0> for l.each do |line| irb(main):003:1* puts line irb(main):004:1> end SyntaxError: compile error (irb):4: parse error, unexpected ''\n'', expecting tCOLON2 or ''['' or ''.'' from (irb):4 -- Alex
Mohammad wrote:>>>><h1>Panel for <%= @user.login %></h1> >>>><h3>Army</h3> >>>><% @army_types.each do |running| %> >>>><% if @user.running != nil %> >>>><%= @army_names[@cell1] %>: <%= @user.running %><br> >>>><% end %> >>>><% @cell1 += 1 %> >>>><% end %> >>>>thats the code >>>> > > it''s the "for" above is the code now but, I can''t do @user.running is > there a way to do somthing like that?What are your models? What is the schema? What are you expecting @user.running to return? -- Alex