Forum: Ruby on Rails Partial Problems

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.
B121c62780dde6d0a3521a2d4dacf613?d=identicon&s=25 levi mccallum (Guest)
on 2006-01-18 08:20
(Received via mailing list)
Hey guys,

I'm having a little trouble working out partials.
I have successfully made a partial work in my list.rhtml, but as I see
it on
the 15min introductry video. They guy uses one partial on multipul
pages.

At the moment I am trying this in my show.rhtml, I write <%= render
:partial
=> "journal" %> and I get this.

NoMethodError in Write#show
> 4: 	<span><%= write.date.to_s(:long) %></span>
>
> Trace of template inclusion: /app/views/write/show.rhtml
>
> RAILS_ROOT: C:/source/lifejournal/public/../config/..
>

If anyone has any answers, please help a n00b.

Thanks
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-01-18 08:35
(Received via mailing list)
I'd venture to guess that @write is a single ActiveRecord object, not
a collection.

If it *is* a collection, you should have named it @writes, at the
very least.

Note: It's not the naming that caused me to suggest the problem, but
it's a
          separate rant of its own. :-)

--
-- Tom Mornini
B121c62780dde6d0a3521a2d4dacf613?d=identicon&s=25 levi mccallum (Guest)
on 2006-01-18 08:38
(Received via mailing list)
Hi Tom,

Just one problem with that, every time I rename it to @writes. I get a
null
error on all my partials.

Thans
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-01-18 13:33
(Received via mailing list)
Must be a keyword collision.

Pick a different name. :-)

--
-- Tom Mornini
This topic is locked and can not be replied to.