Forum: Ruby on Rails Unexpected, Expected

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mohammad (Guest)
on 2006-05-08 21:51
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
Daniel B. (Guest)
on 2006-05-08 22:14
(Received via mailing list)
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.
Mohammad (Guest)
on 2006-05-08 23:10
<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
Alex Y. (Guest)
on 2006-05-08 23:36
(Received via mailing list)
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.
Mohammad (Guest)
on 2006-05-08 23:57
Alex Y. 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
Mohammad (Guest)
on 2006-05-09 00:08
>>> <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?
Alex Y. (Guest)
on 2006-05-09 00:53
(Received via mailing list)
Mohammad wrote:
>>><% @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
Check 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 Y. (Guest)
on 2006-05-09 00:53
(Received via mailing list)
Mohammad wrote:
>
> 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?
This topic is locked and can not be replied to.