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.
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-05-08 19: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
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Daniel Berger (Guest)
on 2006-05-08 20: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.
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-05-08 21: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
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-05-08 21: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.
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-05-08 21:57
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
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-05-08 22: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?
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-05-08 22: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
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-05-08 22: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.