1
<%= form_for(current_user, url: update_my_profile_path, :method => :post, remote: true ) do |f| %>

   First Name: <%= f.text_field :firstname, value: current_user.firstname %>
   Last Name: <%= f.text_field :lastname, value: current_user.lastname %>
   Phone No. <%= f.text_field :phone, value: current_user.phone  %>

<%= f.submit  'update details', remote: true  %>

validation in my Javascript file :

 $("#personal_profile_update form").validate({

        rules: {
                firstname: { //validation rule },

                lastname: { //validation rule }

                }, // End of the rules

      messages: {    } // End of the messges section
});

Here validation works nicely. but when i try to submit the form with remote: true option in both form & f.submit, it does not get submitted. once I remove this jquery.validate this form gets submitted with remote: true option.

is there any way to submit this form with remote: true option being applied validation rules active ???

1 Answer 1

0

This is discussed here and also Judge gem is for client-side validation. RailsCasts has a whole episode on using client-side-validation gem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.