Forum: Ruby on Rails Can you render partial with collection non-existent rows?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-03-21 15:13
Hi,

I'm trying to create a blank input form with a header and many item
lines. I would like to build the item lines dynamically ie not hard code
up to 100 lines into my form. Is it possible to use render partial with
a dummy collection for this? When I try to render with @item_lines
holding 1 object created with .new, I get:

ActionView::TemplateError (undefined method `each_with_index' for
#<Item:0x24c98b8>) on line #22 of app/views/receipts/new.rhtml:
21:
22:     <%= render :partial => 'item_line', :collection => @item_lines
%>

If @item_lines holds objects read from the database, the page renders
OK. Am I approaching this problem the wrong way?

-thanks
Lindsay
36df5a25b0f7e1a39826370b91497167?d=identicon&s=25 Charles Leeds (Guest)
on 2006-03-21 15:36
(Received via mailing list)
I work in a Windows centric environment where everything is
authenticated to Active Directory.  I have Apache authenticating access
to Rails 1.0 apps using mod_sspi and pass-thru NTLM authentication.

It works fine for basic page loads in IE and also IE seems to pass the
NTLM token with each AJAX call as well so IE works fine.

Firefox however works fine and passes NTLM for basic page loads, but
won't pass NTLM authentication for AJAX calls and subsequently asks the
user to log in when they hit something using an auto_complete_for.

Is there a workaround for this that any of you have discovered to either
force Firefox to NTLM authenticate AJAX calls or to work around this in
Rails?

Thanks,
Charles Leeds
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-03-21 15:47
Charels, you might want to re-post the message above.
This topic is locked and can not be replied to.