Ruby on Rails Monday, February 4, 2013

On Sun, Feb 3, 2013 at 5:25 PM, rubyrookie <asajnani@gmail.com> wrote:
> I have a remote form that is being submitted as html intead of javascript on
> second attempt when clicking on update or create. The form gets submitted as
> javascript on first attempt. The form gets submitted as html on second
> attempt. On third attempt it gets submitted as javascript. I want it to get
> submitted as javascript always. Can anyone help me out her to figure it out?
>
> Here is my form
>
> <%= semantic_form_for @restaurant,:remote =>true do |f| %>
> <div class="errors">
>
> </div>
> <%= f.inputs do %>
> <%= f.input :name,:input_html => { :autocomplete =>"off"}%>
> <%= f.input :street %>
> <%= f.input :city %>
> <%= f.input :state %>
> <%= f.input :zip %>
> <%= f.input :country %>
> <%= f.input :phoneNumber, :as => :phone %>
>
> <% end %>
>
>
> <%= f.actions do %>
> <%= f.action :submit, :as => :button %>
>
> <% end %>
> <% end %>

Maybe I'm not getting this, but isn't :remote => true in
semantic_form_for to be used when you're doing AJAX? Your form is
doing a straight HTTP POST it looks like to me...

--
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@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment