Form inside a form

Hi

 I have a main form like below

<%= start_form_tag ({:action => ‘update_sd_ticket’, :method =>
‘post’,:id =>@sd_ticket.id})%>

SD Ticket <%=h @sd_ticket.number %>
<%= render :partial=>'service_desk_part/edit_sd_details' %>
<%= render :partial => 'service_desk_part/view_sd_resolution_details' %>

<%= end_form_tag %>

AND INSIDE THE PARTIAL FILE view_sd_resolution_details (which is
completely inside a div)a link_to_remote is there which replaces this
div and the file define_sd_resolution_ui is called …(This is working)
and in that the following form is there.

<%= form_remote_tag :url => { :action => ‘sd_resolution_save’,
:id => @sd_ticket.id,
:sd_resolution_id=>@sd_resolution_id, :page => params[:page]},
:class => ‘itilform’%>

Resolution <%= text_area("sd_resolution", "resolution", "cols" => 80, "rows" => 5) %> <%= end_form_tag>

BUT THIS FORM ACTION DOES NOT WORK…HOW CAN I OVERCOME THIS?

Sijo

taken from w3c (http://www.w3.org/TR/REC-html32):

“FORM fill-out forms
Requires start and end tags. This element is used to define a
fill-out form for processing by HTTP servers. The attributes are ACTION,
METHOD and ENCTYPE. Form elements can’t be nested.”

–> you can’t put a tag inside a ancestor tag , and that
is pretty much what you are doing. you have to seperate the two.

Sijo:

This is the very same issue that you posted earlier:
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/86adead2460b6ffe/cf2b5a0a344c07a5?lnk=gst&q=Sijo+form+partial#cf2b5a0a344c07a5

I don’t want to discourage you from using Rails, but please do slow
down a bit and study what you are working with. You are posting a lot
of questions and many of the answers share the same or similar root
causes.

Hi Sijo,

Watch the following Railscasts that might give you ideas on how to
solve your problem:

Episode 16: Virtual Attributes
Complex Forms Part 1
Complex Forms Part 2
Complex Forms Part 3

Another trick is to have multiple forms but with submit buttons
targeting a specific form. i.e.

Details
  1. title :
  • title :
  • Upload
  • Hope this was of help…

    Cheers,

    Maruis Marais

    Hi
    Thanks for your help

    Sijo

    Handle the issue of subforms you need to read up on the API regarding
    the fields_for method. See ActionView::Helpers::FormHelper.

    This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

    | Privacy Policy | Terms of Service | Remote Ruby Jobs