Re: [Rails] Re: rendering partial chokes on :locals

2010-01-05 Thread Colin Law
2010/1/5 Laim Bee : >... > > So what's the best way to debug why the create method is not working > properly? Is there a way to set a global variable that would be viewable > from ruby script/console? Have a look at the RoR guide on Debugging at http://guides.rubyonrails.org/ Colin -- You recei

[Rails] Re: rendering partial chokes on :locals

2010-01-04 Thread Laim Bee
Frederick Cheung wrote: > On Jan 2, 5:21�pm, Laim Bee wrote: >> Frederick Cheung wrote: > >> How does Rails know when you click the Submit button, that you want to >> initiate the create method in the comments controller? > > The conventions (in particular REST) that rails uses dictate that to >

[Rails] Re: rendering partial chokes on :locals

2010-01-02 Thread Frederick Cheung
On Jan 2, 5:21 pm, Laim Bee wrote: > Frederick Cheung wrote: > The New Comment form displays ok on the front page (I just took the new > view from the comments controller moved a copy of it into my blogs > view). I then rendered it as a partial. When I click on the "Create" > button, I get a 404

[Rails] Re: rendering partial chokes on :locals

2010-01-02 Thread Laim Bee
Frederick Cheung wrote: > On Dec 28, 3:56�am, Laim Bee wrote: >> I also tried creating a new Note in the production environment (using >> ruby script/server production) and got the following error (See below). >> It looks like a table doesn't exist? Is it possible that when I >> db:migrate 'd my t

[Rails] Re: rendering partial chokes on :locals

2009-12-27 Thread Laim Bee
Aldric Giacomoni wrote: > Laim Bee wrote: >> Aldric Giacomoni wrote: >>> >>> <% note = note rescue Note.new %> >>> But, that is just a band-aid, and it's pretty easy to lose track of >>> quick-fixes like that - what you are doing, passing in a new class, is >>> much closer to the behavior you wa

[Rails] Re: rendering partial chokes on :locals

2009-12-27 Thread Frederick Cheung
On Dec 28, 3:56 am, Laim Bee wrote: > I also tried creating a new Note in the production environment (using > ruby script/server production) and got the following error (See below). > It looks like a table doesn't exist? Is it possible that when I > db:migrate 'd my table, it did it only to the

[Rails] Re: rendering partial chokes on :locals

2009-12-22 Thread Aldric Giacomoni
Laim Bee wrote: > Aldric Giacomoni wrote: >> >> <% note = note rescue Note.new %> >> But, that is just a band-aid, and it's pretty easy to lose track of >> quick-fixes like that - what you are doing, passing in a new class, is >> much closer to the behavior you want to emulate, so it's better. >

[Rails] Re: rendering partial chokes on :locals

2009-12-21 Thread Frederick Cheung
On Dec 21, 1:12 am, Laim Bee wrote: > In the _new_note partial, I put one line of text for testing. If I don't > include " :locals=>{:note=>Note.new} " in my render statement, the text > will pull in fine. Otherwise, I will get a 500 error. Is there something > wrong with the Class (causing the

[Rails] Re: rendering partial chokes on :locals

2009-12-21 Thread Laim Bee
Aldric Giacomoni wrote: > Laim Bee wrote: >> >> -In the View that I am trying to add the partial to, I added the >> following code: >> <%= render :partial=>"new_note", :locals=>{:note=>Note.new} %> >> >> In the _new_note partial, I put one line of text for testing. If I don't >> include " :locals

[Rails] Re: rendering partial chokes on :locals

2009-12-21 Thread Aldric Giacomoni
Laim Bee wrote: > > -In the View that I am trying to add the partial to, I added the > following code: > <%= render :partial=>"new_note", :locals=>{:note=>Note.new} %> > > In the _new_note partial, I put one line of text for testing. If I don't > include " :locals=>{:note=>Note.new} " in my rende