Variable is nil except when being printed (ERB Ruby) -
i trying use variable in view, , i've isolated issue having hard time explaining.
if (to check value indeed set):
<%= story.id %> the variable value prints correctly in each row (they id numbers).
the variable has value.
if try use variable however
<%= integer(story.id) %> i failure
actionview::template::error (can't convert nil integer): 43: integer(story.id) if remove call integer() , leave variable there, starts printing value again.
when variable demonstrably has value, why being recognized nil when dereferenced?
or, asked way,
why variable nil if , if used argument method/function ?
Comments
Post a Comment