[Rails] Re: IDs problem
Sergio Sergio wrote:
> Maybe they have the same id :-), checkout your database and see if they
> have
> the same id
>
> 2010/7/21 Lily ^_^ <lists@ruby-forum.com>
Already checked :)
The parent has ID 3 in its table.
The lesson has ID 1 in its table.
And thetheme.thelesson.id gives "3"...
Well actually it's in an XML builder, maybe you'll find a mistake :
xml.list do
theme.lessons.each do |lesson|
xml.item do
xml.label lesson.title
xml.link "/lessons/" + lesson.id.to_s + ".xml"
end
end
end
The way I'm writing xml.link is really not graceful, I admit. It's the
first time I need to do something such so if there's a nicer way to do
it, i would be glad to know.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home