|
List Info
Thread: Local Variable Troubles
|
|
| Local Variable Troubles |

|
2006-08-15 02:38:10 |
|
Hi all,
I currently have a partial named _menu, where I generate the menu for my site. I pass locals to it with a render :partial. I have the partial check for 2 items, display_title and klass. I only pass these to the partial if I need to use them, otherwise no locals named display_title or klass are present in the partial. I test to see if these exists by doing the following:
<% unless display_title == false %><h3><%= title %></h3><% end %>
<ul class="<%= !klass.nil? ? klass : 'menu' %>">
This has worked for a little while, but recently it no longer worked--I got an "undefined local variable or method" error. I can understand why maybe the first method may not be working, but the second should work. I didn't change anything other than restarting the server before I started having the issues.
Am I doing something completely stupid? If I haven't been too clear on what the problem is, let me know, and I'll try to explain a little better.
Thanks, Kyle
|
| Local Variable Troubles |

|
2006-08-15 23:23:22 |
|
Not to be annoying, but does anyone have any ideas?
On 8/14/06, Kyle Slattery <fidgeting.net">slattery fidgeting.net> wrote:
Hi all,
I currently have a partial named _menu, where I generate the menu for my site. I pass locals to it with a render :partial. I have the partial check for 2 items, display_title and klass. I only pass these to the partial if I need to use them, otherwise no locals named display_title or klass are present in the partial. I test to see if these exists by doing the following:
<% unless display_title == false %><h3><%= title %></h3><% end %>
<ul class="<%= !klass.nil? ? klass : 'menu' %>">
This has worked for a little while, but recently it no longer worked--I got an "undefined
local variable or method" error. I can understand why maybe the first method may not be working, but the second should work. I didn't change anything other than restarting the server before I started having the issues.
Am I doing something completely stupid? If I haven't been too clear on what the problem is, let me know, and I'll try to explain a little better.
Thanks,
Kyle
|
[1-2]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|