On Sun, Sep 30, 2012 at 02:19:49AM -0700, laurent wrote:
>
> (...)
>
> <%= form_for(@study_plan,  :remote => true ) do |f| %>
>
> <%= f.hidden_field :definition_input %>
> <div id="editor" style="margin-left: 10px; margin-top: 10px;"></div>
> <%= f.submit  :onclick => "return validate_form();" %>
> <% end %>
>
> <script>
>  var editor = document.getElementById('editor');
>  var tree = <%= raw(@study_plan.definition_input) %>;
>  FluoEditor.renderFlow(editor, tree);
>
>  // Here is my question : I have button with FluoEditor, but click on these
>  // buttons generate a full html request (a link_to and not a update)
>  // Console Log when FluoEditor is click :
>  // Started GET "/study_plans/1/edit" for 127.0.0.1 at 2012-09-30 10:45:54
> +0200
>  // Processing by StudyPlansController#edit as HTML
>  ….
>
>  function validate_form(){
> var spdi = document.getElementById('study_plan_definition_input');
>    spdi.value = RuoteFluoEditor.asJson('editor');
>   }
> </script>

Hello,

not a ruote question, but I'll do my best.

What about

  <%= form_for(@study_plan,  :remote => true, :method => :post) do |f| %>

?

That should turn your GET into a POST hopefully.

Don't hesitate to look at the HTML generated for you. It won't bite.

Note: from the point of view of a server (console log), a HTTP request is a
HTTP request, no magical "AJAX" happening...

This might help:

  http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html


Best regards,

--
John Mettraux - http://lambda.io/jmettraux

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to