I''m getting a syntax error when rendering a partial. This is a simple html partial with one instance variable inside it. Rendering as a "template" instead of as a partial works just fine. The error occurs 3 lines after the last line of HTML code in the partial. There is no line 72! Here is the error: SyntaxError in Building_blocks#preview Showing building_blocks/_BB02.html.erb where line #72 raised: compile error C:/Ruby_Development/sbtool/app/views/building_blocks/_BB02.html.erb:-2: dynamic constant assignment BB02 = local_assigns[:BB02] ^ C:/Ruby_Development/sbtool/app/views/building_blocks/_BB02.html.erb:-1: dynamic constant assignment BB02_counter = local_assigns[:BB02_counter] Extracted source (around line #72): 69: </html> 70: Application Trace: app/views/building_blocks/_BB02.html.erb:72:in `compile_template'' app/controllers/building_blocks_controller.rb:99:in `preview'' script\server:3 -e:2:in `load'' -e:2 -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-29 15:19 UTC
Re: Render partial yields "dynamic constant assignment"
On 29 May 2008, at 16:04, Corey Murphy wrote:> > I''m getting a syntax error when rendering a partial. This is a simple > html partial with one instance variable inside it. Rendering as a > "template" instead of as a partial works just fine. The error > occurs 3 > lines after the last line of HTML code in the partial. There is no > line > 72! Here is the error:Don''t start your partial names with a capital letter. rails creates a local variable for the object corresponding to the partial and local variables can''t start with a capital letter Fred -- My ramblings: http://www.spacevatican.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Corey Murphy
2008-May-29 15:27 UTC
Re: Render partial yields "dynamic constant assignment"
Frederick Cheung wrote:> On 29 May 2008, at 16:04, Corey Murphy wrote: > >> >> I''m getting a syntax error when rendering a partial. This is a simple >> html partial with one instance variable inside it. Rendering as a >> "template" instead of as a partial works just fine. The error >> occurs 3 >> lines after the last line of HTML code in the partial. There is no >> line >> 72! Here is the error: > > Don''t start your partial names with a capital letter. rails creates a > local variable for the object corresponding to the partial and local > variables can''t start with a capital letter > > Fred > > > -- > My ramblings: http://www.spacevatican.orgDoh! I should know that. Standard ruby "convention". Thanks Fred, as always! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Seemingly Similar Threads
- ERB and Builder template engines shouldn''t be so heavily wired in ActionView::Base
- best way to set default for an optional local in a partial?
- stub sub partials when testing partial with rspec
- Preserving fallback with RJS
- link_to_function check javascript attribute