[Rails] Re: local variables in partials lead to NameError

2009-02-26 Thread Jamie Forrest
Aha! Posting the full error text led me to read it more carefully. There's a line in there that says: app/helpers/listings_helper.rb:3:in `add_image_link' Looked in add_image_link, which is a helper that dynamicall adds more copies of the same partial. Needed to add the local variables there too

[Rails] Re: local variables in partials lead to NameError

2009-02-26 Thread Jamie Forrest
Thanks for your help Bill, The partial is in a folder called views/listings because it is shared by two different models, ResidentialListing and CommercialListing, both of which inherit (via STI) from a Listing model. The error is occuring in Residential_listings#new because that is the template

[Rails] Re: local variables in partials lead to NameError

2009-02-26 Thread Jamie Forrest
I should also say that I have partial locals in other parts of my code that are working fine, as in my edit.html.erb: <%= render :partial => 'form', :locals => {:residential_listing => @residential_listing} %> --~--~-~--~~~---~--~~ You received this message because

[Rails] Re: local variables in partials lead to NameError

2009-02-26 Thread Jamie Forrest
> Without seeing more code, I'd guess you're passing a local to that > partial without passing the value you're assigning to the local to the > view / partial above.  But that's just a guess.  Post some additional > code for additional assistance. Hi Bill, I could certainly post more code, but f

[Rails] Re: local variables in partials lead to NameError

2009-02-25 Thread Jamie Forrest
> does > > <%= foo %> > > work? Sorry that was a typo in my original message. I have <%= foo %> in my partial and it doesn't work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post

[Rails] local variables in partials lead to NameError

2009-02-25 Thread Jamie Forrest
I know I must be doing something dumb, but I can't seem to send a local variable to my partial. The below code leads to the following error: NameError in Residential_listings#new undefined local variable or method `foo' for # I am trying to call the variable 'foo' in a partial called _attachment

[Rails] Re: manually setting an auto-incremented primary key id

2009-02-12 Thread Jamie Forrest
On Feb 12, 6:35 pm, Rob Biedenharn wrote: > On Feb 12, 2009, at 4:21 PM, Jamie Forrest wrote: > > > > > I want to create a record with a manually-set custom ID, for instance: > > > Foo.create(:id => 8000, :name =>"bar") > > > But when I try t

[Rails] manually setting an auto-incremented primary key id

2009-02-12 Thread Jamie Forrest
I want to create a record with a manually-set custom ID, for instance: Foo.create(:id => 8000, :name =>"bar") But when I try to do that, Rails ignores the id I pass and continues to auto-increment the id in the table. So in other words the console output is along the lines of: >> Foo.find(:last