Hi - how do you trigger an xml response for "respond_to do |format|' ?
Wondering why the following isn't working for me (i.e. triggers HTML
response)
------------------view ----------------
<% *remote_form_for* :bi_allocation, @bi_allocation, :url => { :controller
=> "bi_allocation", *:action => "r_create"*} do |f| %>
<%= f.text_field :amount, :size => 10 %>
<%= submit_tag 'Create' %>
<% end %>
------------ controller ---------------------
*def r_create*
@bi_allocation = BiAllocation.new(params[:bi_allocation])
respond_to do |format|
if @bi_allocation.save
format.html raise("*** *HITS THIS LINE* ***")
format.xml { render :xml => @bi_allocation, :status => :created,
:location => @bi_allocation} *# Doesn't hit this line*
else
format.html { render :action => "xxxx" }
format.xml { render :xml => @bi_allocation.errors }
end
end
end
thanks
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---