Problem on the view

16 views
Skip to first unread message

André Luiz Abdalla Silveira

unread,
Jan 2, 2018, 5:24:36 PM1/2/18
to Ruby on Rails: Talk


Hi folks, Happy new year

I'm having problems buillding my views, can you help me? I want every team to be printed with different colors, and so I created a migration to include these fields

Hassan Schroeder

unread,
Jan 2, 2018, 5:45:13 PM1/2/18
to rubyonrails-talk
On Tue, Jan 2, 2018 at 2:24 PM, André Luiz Abdalla Silveira
<andrel...@gmail.com> wrote:

> I'm having problems buillding my views, can you help me? I want every team
> to be printed with different colors, and so I created a migration to include
> these fields

The problem is exactly as stated in the error message: you've added
attributes to Team but you're trying to access "color1" as an attribute
of a String (the team name).

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

radhames brito

unread,
Jan 3, 2018, 9:25:09 AM1/3/18
to Ruby on Rails: Talk
You have `partida.away` that returns a string, string does not have the method `color1` I think you want to do, `partida.color1`. You error is that you have `partida.away.color1`, its the same as saying `'Colorado Rockies'.color1` which makes no sense.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2cb07abc-3978-4d60-987f-a44c4b3544bc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

André Luiz Abdalla Silveira

unread,
Jan 4, 2018, 6:28:32 AM1/4/18
to Ruby on Rails: Talk
Shame on me, lol. Thank you folks. Really appreciate your help


Em quarta-feira, 3 de janeiro de 2018 12:25:09 UTC-2, radhames brito escreveu:
You have `partida.away` that returns a string, string does not have the method `color1` I think you want to do, `partida.color1`. You error is that you have `partida.away.color1`, its the same as saying `'Colorado Rockies'.color1` which makes no sense.
On Tue, Jan 2, 2018 at 6:24 PM, André Luiz Abdalla Silveira <andrel...@gmail.com> wrote:


Hi folks, Happy new year

I'm having problems buillding my views, can you help me? I want every team to be printed with different colors, and so I created a migration to include these fields

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages