Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Partial names can't end in keywords? #7079

Closed
krainboltgreene opened this Issue · 4 comments

2 participants

@krainboltgreene

Got this error, and others, today:

2012-07-17T19:11:24+00:00 app[web.1]: ActionView::Template::Error (/app/app/views/application/_nav-dropdown-logged-in.html.erb:1: syntax error, unexpected keyword_in, expecting keyword_end
2012-07-17T19:11:24+00:00 app[web.1]: ...tput_buffer = @output_buffer;in = local_assigns[:in];;@outpu...
2012-07-17T19:11:24+00:00 app[web.1]: ...                               ^):
2012-07-17T19:11:24+00:00 app[web.1]:     1: <li><%= link_to "Sign Out", signout_path %></li>
2012-07-17T19:11:24+00:00 app[web.1]:   app/views/application/_header.html.erb:23:in `_app_views_application__header_html_erb___3615617317639999208_12037660'
2012-07-17T19:11:24+00:00 app[web.1]:   app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__1785395058221080002_11902360'
2012-07-17T19:11:24+00:00 app[web.1]: 

The problem is the partial name I chose:

render partial: 'nav-dropdown-logged-in'

This happens if I use these as well, but with the specific error message relating to using the keyword wrong:

render partial: 'nav-dropdown-logged-class'
render partial: 'nav-dropdown-logged-end'
render partial: 'nav-dropdown-logged-def'
render partial: 'nav-dropdown-logged-if'
@kennyj kennyj referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@kennyj kennyj referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@kennyj kennyj referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@kennyj
Collaborator

I can reproduce this issue, and I realize the cause of problem (maybe).

I guess this issue consists of two problem.

First: we can't use partial name with hyphen, only [a-zA-Z0-9_]
Second: Rails's retrieving variable logic has a little problem.

I fixed the second problem, but I think the first one is specification.

p.s. sorry, my multiple commits ...

@kennyj kennyj referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@kennyj
Collaborator

@krainboltgreene wdyt?

BTW, I found the next error message

The partial name (test/a-in) is not a valid Ruby identifier;
make sure your partial name starts with a lowercase letter or underscore, and is followed by any combination of letters, numbers and underscores.
@krainboltgreene

Sounds great to me!

@kennyj
Collaborator

thanks !
I sent the PR to fix second problem.

@kennyj kennyj closed this in a8d68d8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.