Partials not working

I tried to make a partial but it threw this:
http://rafb.net/paste/results/rZAFTV34.html

I thought it was weird since this wasnt a very complicated case so I
made it simpler. Now I have a partial empty rhtml and calling it with
“render :partial => “shared/list”” but it still gives me the same error.

How can I beat this? I’m really stuck at this now.

Hi –

On Mon, 25 Sep 2006, RoR newbie wrote:

I tried to make a partial but it threw this:
http://rafb.net/paste/results/rZAFTV34.html

I thought it was weird since this wasnt a very complicated case so I
made it simpler. Now I have a partial empty rhtml and calling it with
“render :partial => “shared/list”” but it still gives me the same error.

How can I beat this? I’m really stuck at this now.

You’re going through one of the nuby (Ruby newbie) rites of passage
:slight_smile:

Don’t use ‘class’ as a local variable or method name. Ruby sees it
and thinks you mean the keyword ‘class’.

David


David A. Black | [email protected]
Author of “Ruby for Rails” [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB’s Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] Ruby for Rails | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org

unknown wrote:

Hi –

On Mon, 25 Sep 2006, RoR newbie wrote:

I tried to make a partial but it threw this:
http://rafb.net/paste/results/rZAFTV34.html

I thought it was weird since this wasnt a very complicated case so I
made it simpler. Now I have a partial empty rhtml and calling it with
“render :partial => “shared/list”” but it still gives me the same error.

How can I beat this? I’m really stuck at this now.

You’re going through one of the nuby (Ruby newbie) rites of passage
:slight_smile:

Don’t use ‘class’ as a local variable or method name. Ruby sees it
and thinks you mean the keyword ‘class’.

David


David A. Black | [email protected]
Author of “Ruby for Rails” [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB’s Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] Ruby for Rails | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org

Yeah, I first thought about that too and I did have :locals { :class =>
something } but as I said I made it a lot simpler, as simple as it can
be I think. Currently the shared/_link.rhtml is “

text

”.

Hi –

On Mon, 25 Sep 2006, RoR newbie wrote:

Don’t use ‘class’ as a local variable or method name. Ruby sees it
and thinks you mean the keyword ‘class’.

Yeah, I first thought about that too and I did have :locals { :class =>
something } but as I said I made it a lot simpler, as simple as it can
be I think. Currently the shared/_link.rhtml is “

text

”.

If you’re still getting the same error message then it’s still picking
up class as a local from somewhere. Usually that’s a sign of either
caching or else accidentally editing the file in the wrong directory.
(It really does happen! :slight_smile:

David


David A. Black | [email protected]
Author of “Ruby for Rails” [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB’s Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] Ruby for Rails | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org

unknown wrote:

Hi –

On Mon, 25 Sep 2006, RoR newbie wrote:

Don’t use ‘class’ as a local variable or method name. Ruby sees it
and thinks you mean the keyword ‘class’.

Yeah, I first thought about that too and I did have :locals { :class =>
something } but as I said I made it a lot simpler, as simple as it can
be I think. Currently the shared/_link.rhtml is “

text

”.

If you’re still getting the same error message then it’s still picking
up class as a local from somewhere. Usually that’s a sign of either
caching or else accidentally editing the file in the wrong directory.
(It really does happen! :slight_smile:

David


David A. Black | [email protected]
Author of “Ruby for Rails” [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB’s Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] Ruby for Rails | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org

Ah, it must’ve been caching or something because I restarted the web
server and it worked.

Thanks.