Hey Guys i''m New to Rails (3 weeks now) and i''m Trying to render a Partial from my *app/views/pins *to my *layouts/_header *(My Menu) in a Modal. Im Using Bootstrap. So i render it with <%= render *"pins/form"* %> but i get an undefined method `model_name'' for NilClass:Class.] My Modal Looks Like This : <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="myModalLabel">Modal header</h3> </div> <div class="modal-body"> <%= render ''pins/form'' %> </div> <div class="modal-footer"> <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> <button class="btn btn-primary">Save changes</button> </div> </div> I searched 2 days now for a possible solution but found nothing :( Can anybody help me ? Thanks, Johnny -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c728c239-fd93-4b78-8e6f-dce1ed076f63%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On Mon, Jul 15, 2013 at 1:47 PM, Giannakis Prime <admin-u6hEZlbBh8Uao0Rb761BDQ@public.gmane.org> wrote:> So i render it with <%= render "pins/form" %> but i get an undefined method > `model_name'' for NilClass:Class.]So find the object that ''model_name'' is being called on and figure out why it''s nil. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yD%3D13Jjs%3D5m04bAsbacg5T_W%3DJ_wvO70cSHwr-Fdi-tCQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
On 15 July 2013 21:47, Giannakis Prime <admin-u6hEZlbBh8Uao0Rb761BDQ@public.gmane.org> wrote:> Hey Guys i''m New to Rails (3 weeks now) and i''m Trying to render a Partial > from my app/views/pins to my layouts/_header (My Menu) in a Modal. Im Using > Bootstrap. > So i render it with <%= render "pins/form" %> but i get an undefined method > `model_name'' for NilClass:Class.]If you look through the call stack that should have been displayed in the server window then you should find it referencing one of your lines of code. There you will find which object is nil. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLv%2BpHAqqC7sQL%2B3mekDw7VHaS8mmN91B6MV8qRaawF1nw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.