Hi group, i have a rather weird problem - if i use f.submit on my form, the controller calls #destroy. i can workaround that if i use button_to "update", :controller => :mycontroller, :action => :update, but i don''t really want that, and i want to get this issue fixed. anyone ever encountered this bug and found a solution? routes are absolutely okay. greetings -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi. Could you post all the code of your form? On Mon, Nov 21, 2011 at 11:20 AM, manavortex <ewa.baumgarten-VvJRU8JoNjXQT0dZR+AlfA@public.gmane.org>wrote:> Hi group, > i have a rather weird problem - if i use f.submit on my form, the > controller calls #destroy. > i can workaround that if i use button_to "update", :controller > => :mycontroller, :action => :update, but i don''t really want that, > and i want to get this issue fixed. > > anyone ever encountered this bug and found a solution? > > routes are absolutely okay. > > greetings > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
it''s rather complex, but here it is: it belongs to a polymorphic association with "resource". luckily, the other polymorphic children of resource still work fine, it''s just with this one. the partials are just for keeping things organized, none of these does anything terrible. i''d be glad if someone was able to help! <%= render ''layouts/form'' %> <%= render :partial=>''resources/form'' %> <%= render :partial => ''shared/overlay_init'' %> <div class="content-background"> <div class="content-show"> <%= render :partial => ''shared/site_header'', :locals => {:breadcrumbs => " Administration | Medienobjekte", :heading => @heading, :subnav => "" } %> <%= form_for @concrete_resource, :html => { :multipart => true } do | f| %> <% if @concrete_resource.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@concrete_resource.errors.count, "error") %> prohibited this concrete_resource from being saved:</h2> <ul> <% @concrete_resource.errors.full_messages.each do |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <br/> <div class="form-content"> <%= render :partial => ''resources/title_category_tags''%> <div class="form-element-container" style="border-bottom: 1px dotted black"> <div class="form-element-caption"> Copyright-Hinweis: </div> <div class="form-element"> <%= f.text_field :copyright, :class =>"cleardefault"%> </div> </div> <div class="form-element-container" style="border-bottom: 1px dotted black"> <div class="form-element-caption"> Copyright-Informationen (intern): </div> <div class="form-element"> <%= f.text_area :copyright_information, :class => "smallarea"%> </div> </div> <div class="form-element-container"> <div class="form-element-caption"> Bild hochladen: </div> <div class="form-element"> <%= f.file_field :medium_image%> </div> <div style="float:left; margin-left: -160px; width: 560px;"> (Bildformat: 340x257 Pixel) </div> </div> <% if params[:subtype].nil? && !params[:type].nil? %> <%= render :partial => ''media/forms/'' + params[:type] + ''form'' %> <% elsif !params[:subtype].nil? %> <%= render :partial => ''media/forms/subtype_forms/'' + params[:subtype] + ''form'' %> <% else %> <%= render :partial => @concrete_resource.get_form %> <% end %> <br> <div class="popmenu popmenu-button-left popmenu-hide" style="width:850px;" title="Projektbeschreibung"> <div class="form-left"> <div class="form-element-caption"> Einleitung <span style="color:red">*</span> </div> <div style="width:560px; float:left;"> <%= f.text_area :teaser, :class => "mceSimple" %> </div> <div style="width:560px; border-top: 1px dotted black; margin-top:20px; margin-bottom:15px; float:left;"></div> <div class="form-element-caption" style="width:160px;"> Projektbeschreibung <span style="color:red">*</span> </div><br> <div style="width:560px; float:left;"> <%= f.text_area :long_description, :class => "mceBig" %> </div> </div> <div class="form-right" style=" width: 230px;"> <br> blah blah blah </div> </div> </div> <div class="popmenu popmenu-button-left popmenu-show" title="Medium-Ressourcen" style="margin-top:20px; width: 850px;"> <div class="form-left"> <%= render :partial => ''resources/ related_resources_form'' %> <div class="actions" style="width: 350px;float:left;margin-top:15px;"> <%= f.submit "Medium aktualisieren und speichern" %> </div> </div> <div class="form-right"> blah blah blah </div> </div> <div class="actions" style="width: 350px;float:left;"> <%# button_to "Medium aktualisieren und speichern", :controller => :media, :action => :update %> <% f.submit "Medium aktualisieren und speichern" %> </div> <%= render :partial => "resources/form_footer", :locals => {:object => @concrete_resource, :name => "Medium", :plural => "Medien"} %> </div> <% end %> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 21 November 2011 13:20, manavortex <ewa.baumgarten-VvJRU8JoNjXQT0dZR+AlfA@public.gmane.org> wrote:> Hi group, > i have a rather weird problem - if i use f.submit on my form, the > controller calls #destroy.What do you see in the log when you click submit? Also when odd things are happening it is always a good idea to check the web page for valid html. Copy the complete html source from the browser and paste it into the w3c html validator. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 24 Nov 2011, at 17:12, manavortex <ewa.baumgarten-VvJRU8JoNjXQT0dZR+AlfA@public.gmane.org> wrote:> it''s rather complex, but here it is: > > it belongs to a polymorphic association with "resource". luckily, the > other polymorphic children of resource still work fine, it''s just with > this one. the partials are just for keeping things organized, none of > these does anything terrible. > > i''d be glad if someone was able to help! >Do any of those partials render forms? Nesting forms is a definite bad idea. Fred> > <%= render ''layouts/form'' %> > <%= render :partial=>''resources/form'' %> > <%= render :partial => ''shared/overlay_init'' %> > > <div class="content-background"> > <div class="content-show"> > > <%= render :partial => ''shared/site_header'', > :locals => {:breadcrumbs => " Administration | > Medienobjekte", > :heading => @heading, > :subnav => "" > } %> > > <%= form_for @concrete_resource, :html => { :multipart => true } do | > f| %> > <% if @concrete_resource.errors.any? %> > <div id="error_explanation"> > <h2><%= pluralize(@concrete_resource.errors.count, > "error") %> prohibited this concrete_resource from being saved:</h2> > <ul> > <% @concrete_resource.errors.full_messages.each do |msg| > %> > <li><%= msg %></li> > <% end %> > </ul> > </div> > <% end %> > <br/> > > <div class="form-content"> > > <%= render :partial => ''resources/title_category_tags''%> > > <div class="form-element-container" style="border-bottom: 1px > dotted black"> > <div class="form-element-caption"> > Copyright-Hinweis: > </div> > <div class="form-element"> > <%= f.text_field :copyright, :class =>"cleardefault"%> > </div> > </div> > > > <div class="form-element-container" style="border-bottom: 1px > dotted black"> > <div class="form-element-caption"> > Copyright-Informationen (intern): > </div> > <div class="form-element"> > <%= f.text_area :copyright_information, :class => > "smallarea"%> > </div> > </div> > > > > <div class="form-element-container"> > <div class="form-element-caption"> > Bild hochladen: > </div> > <div class="form-element"> > <%= f.file_field :medium_image%> > </div> > <div style="float:left; margin-left: -160px; width: 560px;"> > (Bildformat: 340x257 Pixel) > </div> > </div> > > <% if params[:subtype].nil? && !params[:type].nil? %> > <%= render :partial => ''media/forms/'' + params[:type] + ''form'' > %> > <% elsif !params[:subtype].nil? %> > > <%= render :partial => ''media/forms/subtype_forms/'' + > params[:subtype] + ''form'' %> > <% else %> > <%= render :partial => @concrete_resource.get_form %> > <% end %> > <br> > > <div class="popmenu popmenu-button-left popmenu-hide" > style="width:850px;" title="Projektbeschreibung"> > > <div class="form-left"> > <div class="form-element-caption"> > Einleitung <span style="color:red">*</span> > </div> > <div style="width:560px; float:left;"> > <%= f.text_area :teaser, :class => "mceSimple" %> > </div> > > <div style="width:560px; border-top: 1px dotted black; > margin-top:20px; margin-bottom:15px; float:left;"></div> > > <div class="form-element-caption" style="width:160px;"> > Projektbeschreibung <span style="color:red">*</span> > </div><br> > <div style="width:560px; float:left;"> > <%= f.text_area :long_description, :class => "mceBig" %> > </div> > </div> > > <div class="form-right" style=" width: 230px;"> > <br> > blah blah blah > </div> > </div> > </div> > > > > > > <div class="popmenu popmenu-button-left popmenu-show" > title="Medium-Ressourcen" style="margin-top:20px; width: 850px;"> > > <div class="form-left"> > <%= render :partial => ''resources/ > related_resources_form'' %> > <div class="actions" style="width: > 350px;float:left;margin-top:15px;"> > <%= f.submit "Medium aktualisieren und speichern" %> > </div> > > </div> > <div class="form-right"> > blah blah blah > </div> > > </div> > > > > > > > > <div class="actions" style="width: 350px;float:left;"> > <%# button_to "Medium aktualisieren und > speichern", :controller => :media, :action => :update %> > <% f.submit "Medium aktualisieren und speichern" %> > > </div> > > <%= render :partial => "resources/form_footer", :locals => > {:object => @concrete_resource, :name => "Medium", :plural => > "Medien"} %> > > > > > > </div> > > > > <% end %> > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.