Try this:
<%= render :partial => 'report_form', :locals => { :r => 1} %>
-Bill
Jon Druse wrote:
Try this:
<%= render :partial => 'report_form', :locals => { :r => 1} %>
-Bill
Jon Druse wrote:
Can you paste in the error you are getting when trying my suggestion? I use this in many places with no issues.
-Bill
Jon Druse wrote:
That appears to be the error from the browser. What is in your logs? I suspect there is more info waiting in development.log that will help you on this.
-Bill
Jon Druse wrote:
No, there is something else going on here. I use underscores in many partial names.
-Bill
Jon Druse wrote:
Jon Druse wrote:
this error isn't making any sense to me. thanks for your help.. ok i fixed it but you'll never guess how... my partial was named _report_form.rhtml.. when i changed it to _reportform.rhtml.. now it works! should this be reported somewhere? i've never heard that you can have underscores in the partial name. let me know what you guys think. I've used partials like _list_header.rhtml in the past, so it seems a bit odd to see what you say. I haven't followed your thread so far but how are you calling it from your view code?
Cheers Mohit.
Jon Druse wrote:
Mohit Sindhwani wrote:
I've used partials like _list_header.rhtml in the past, so it seems a bit odd to see what you say. I haven't followed your thread so far but how are you calling it from your view code?
Cheers Mohit. View :
-------------
<%= render :partial => 'reportform', :locals => { :r => 1} %>
-------------
Jon, I think that should be:
<%= render :partial => 'report_form', :locals => { :r => 1} %>
(note the underscore after report)
Rails won't insert too many extra underscores for you
Cheers, Mohit. 11/6/2007 | 1:49 AM.
Jon Druse wrote:
<%= render :partial => 'report_form', :locals => { :r => 1} %>
(note the underscore after report) i changed the partial name to 'reportform.rhtml', that's how i got it to work we were just trying to find out why it didn't work before, when i did have the underscore in there. man this is getting confusing.
Like I said, I missed the earlier part of the thread but this is what the rules are (which I think you know):
:partial => 'report_form' ---> partial called _report_form.rhtml
:partial => 'reportform' ---> partial called _reportform.rhtml
I guess somewhere in the debugging you did, an extra underscore got added or one got removed, and the 2 were not consistent any longer
Cheers, Mohit. 11/6/2007 | 1:56 AM.
Actually, can I see the reportform.rhtml view? I think that is where the error is coming from. Did you look at development.log to get the full error and stack trace? If you paste that in, it would be a huge help.
-Bill
Jon Druse wrote: